FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-127960 Fix the REPL to set the correct namespace by setting the correct `__main__` module (gh-134275) by miss-islington · Pull Request #134473 · python/cpython · GitHub

/ cpython Public

[3.14] gh-127960 Fix the REPL to set the correct namespace by setting the correct __main__ module (gh-134275) - #134473

Merged
ambv merged 1 commit into
python:3.14from
miss-islington:backport-b1b8962-3.14
May 22, 2025
Merged

[3.14] gh-127960 Fix the REPL to set the correct namespace by setting the correct __main__ module (gh-134275)#134473
ambv merged 1 commit into
python:3.14from
miss-islington:backport-b1b8962-3.14

Conversation

miss-islington commented May 22, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The __main__ module imported in the _pyrepl module points to the _pyrepl module itself when the interpreter was launched without -m option and didn't execute a module,
while it's an unexpected behavior that __main__ can be _pyrepl and relative imports such as from . import * works based on the _pyrepl module.
(cherry picked from commit b1b8962)

Co-authored-by: Yuichiro Tachibana (Tsuchiya) t.yic.yt@gmail.com
Co-authored-by: Łukasz Langa lukasz@langa.pl

…the correct `__main__` module (pythongh-134275)

The `__main__` module imported in the `_pyrepl` module points to the `_pyrepl` module itself when the interpreter was launched without `-m` option and didn't execute a module,
while it's an unexpected behavior that `__main__` can be `_pyrepl` and relative imports such as `from . import *` works based on the `_pyrepl` module.
(cherry picked from commit b1b8962)

Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL