mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-121790: Fix interactive console initialization (#121793)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
d23be3947c
commit
e5c7216f37
6 changed files with 85 additions and 42 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue