aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/_pyrepl/simple_interact.py
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2024-06-26 15:01:10 -0400
committerGitHub <noreply@github.com>2024-06-26 15:01:10 -0400
commitd611c4c8e9893c0816969e19ab6ca4992a3a15e3 (patch)
tree8fb08a5af46f8bb2ca83c91d4b4a20f8ca896c07 /Lib/_pyrepl/simple_interact.py
parente51e880e75d79687b54a71351266e29ee349b4b8 (diff)
downloadcpython-d611c4c8e9893c0816969e19ab6ca4992a3a15e3.tar.gz
cpython-d611c4c8e9893c0816969e19ab6ca4992a3a15e3.zip
gh-118908: Use __main__ for the default PyREPL namespace (#121054)
Diffstat (limited to 'Lib/_pyrepl/simple_interact.py')
-rw-r--r--Lib/_pyrepl/simple_interact.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/_pyrepl/simple_interact.py b/Lib/_pyrepl/simple_interact.py
index 2de3b38c37a..bc16c1f6a23 100644
--- a/Lib/_pyrepl/simple_interact.py
+++ b/Lib/_pyrepl/simple_interact.py
@@ -80,23 +80,13 @@ REPL_COMMANDS = {
"clear": _clear_screen,
}
-DEFAULT_NAMESPACE: dict[str, Any] = {
- '__name__': '__main__',
- '__doc__': None,
- '__package__': None,
- '__loader__': None,
- '__spec__': None,
- '__annotations__': {},
- '__builtins__': builtins,
-}
def run_multiline_interactive_console(
- mainmodule: ModuleType | None = None,
+ namespace: dict[str, Any],
future_flags: int = 0,
console: code.InteractiveConsole | None = None,
) -> None:
from .readline import _setup
- namespace = mainmodule.__dict__ if mainmodule else DEFAULT_NAMESPACE
_setup(namespace)
if console is None: