mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
gh-118628: Don't display pyrepl warning on Windows (#118665)
This commit is contained in:
parent
67ce820d51
commit
9bf00322ba
1 changed files with 7 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
CAN_USE_PYREPL = True
|
CAN_USE_PYREPL = sys.platform != "win32"
|
||||||
|
|
||||||
|
|
||||||
def interactive_console(mainmodule=None, quiet=False, pythonstartup=False):
|
def interactive_console(mainmodule=None, quiet=False, pythonstartup=False):
|
||||||
global CAN_USE_PYREPL
|
global CAN_USE_PYREPL
|
||||||
|
@ -21,7 +22,7 @@ def interactive_console(mainmodule=None, quiet=False, pythonstartup=False):
|
||||||
sys.ps1 = ">>> "
|
sys.ps1 = ">>> "
|
||||||
if not hasattr(sys, "ps2"):
|
if not hasattr(sys, "ps2"):
|
||||||
sys.ps2 = "... "
|
sys.ps2 = "... "
|
||||||
#
|
|
||||||
run_interactive = None
|
run_interactive = None
|
||||||
try:
|
try:
|
||||||
import errno
|
import errno
|
||||||
|
@ -33,7 +34,10 @@ def interactive_console(mainmodule=None, quiet=False, pythonstartup=False):
|
||||||
from .simple_interact import run_multiline_interactive_console
|
from .simple_interact import run_multiline_interactive_console
|
||||||
run_interactive = run_multiline_interactive_console
|
run_interactive = run_multiline_interactive_console
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"warning: can't use pyrepl: {e}", file=sys.stderr)
|
from .trace import trace
|
||||||
|
msg = f"warning: can't use pyrepl: {e}"
|
||||||
|
trace(msg)
|
||||||
|
print(msg, file=sys.stderr)
|
||||||
CAN_USE_PYREPL = False
|
CAN_USE_PYREPL = False
|
||||||
if run_interactive is None:
|
if run_interactive is None:
|
||||||
return sys._baserepl()
|
return sys._baserepl()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue