diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-07-15 22:49:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 22:49:41 (GMT) |
commit | 5b718e7fc723d484951aa76abd176aadcd0d1518 (patch) | |
tree | dd3306e9fc52d3701f96cf185da2a7f0451267a9 /Lib/_pyrepl/main.py | |
parent | 0794220a6935a25bd9667be60b0c67403bc73f47 (diff) | |
download | cpython-5b718e7fc723d484951aa76abd176aadcd0d1518.zip cpython-5b718e7fc723d484951aa76abd176aadcd0d1518.tar.gz cpython-5b718e7fc723d484951aa76abd176aadcd0d1518.tar.bz2 |
[3.13] gh-121790: Fix interactive console initialization (GH-121793) (GH-121822)
(cherry picked from commit e5c7216f376a06d2c931daf999e2980e494e747e)
Co-authored-by: Milan Oberkirch <milan.oberkirch@geops.com>
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/_pyrepl/main.py')
-rw-r--r-- | Lib/_pyrepl/main.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/_pyrepl/main.py b/Lib/_pyrepl/main.py index 946bf33..8d6e07d 100644 --- a/Lib/_pyrepl/main.py +++ b/Lib/_pyrepl/main.py @@ -23,7 +23,7 @@ else: def interactive_console(mainmodule=None, quiet=False, pythonstartup=False): if not CAN_USE_PYREPL: - if not os.environ.get('PYTHON_BASIC_REPL', None) and FAIL_REASON: + if not os.getenv('PYTHON_BASIC_REPL') and FAIL_REASON: from .trace import trace trace(FAIL_REASON) print(FAIL_REASON, file=sys.stderr) @@ -51,5 +51,7 @@ def interactive_console(mainmodule=None, quiet=False, pythonstartup=False): if not hasattr(sys, "ps2"): sys.ps2 = "... " + from .console import InteractiveColoredConsole from .simple_interact import run_multiline_interactive_console - run_multiline_interactive_console(namespace) + console = InteractiveColoredConsole(namespace, filename="<stdin>") + run_multiline_interactive_console(console) |