SIGN IN SIGN UP

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

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 b1b8962443e7d418601658a4b05347a5a9161910)

Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
M
Miss Islington (bot) committed
998991513b3300c3c6627857df92db81a40355c9
Parent: 93ab55b
Committed by GitHub <noreply@github.com> on 5/22/2025, 1:33:35 AM