mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-45296: Fix exit/quit message on Windows (GH-28577)
IDLE recognizes Ctrl-D, as on other systems, instead of Ctrl-Z.
This commit is contained in:
parent
a47d67cf46
commit
e649e0658f
3 changed files with 16 additions and 0 deletions
|
@ -66,6 +66,13 @@ use_subprocess = False
|
|||
HOST = '127.0.0.1' # python execution server on localhost loopback
|
||||
PORT = 0 # someday pass in host, port for remote debug capability
|
||||
|
||||
try: # In case IDLE started with -n.
|
||||
eof = 'Ctrl-D (end-of-file)'
|
||||
exit.eof = eof
|
||||
quit.eof = eof
|
||||
except NameError: # In case python started with -S.
|
||||
pass
|
||||
|
||||
# Override warnings module to write to warning_stream. Initialize to send IDLE
|
||||
# internal warnings to the console. ScriptBinding.check_syntax() will
|
||||
# temporarily redirect the stream to the shell window to display warnings when
|
||||
|
|
|
@ -40,6 +40,13 @@ if not hasattr(sys.modules['idlelib.run'], 'firstrun'):
|
|||
|
||||
LOCALHOST = '127.0.0.1'
|
||||
|
||||
try:
|
||||
eof = 'Ctrl-D (end-of-file)'
|
||||
exit.eof = eof
|
||||
quit.eof = eof
|
||||
except NameError: # In case subprocess started with -S (maybe in future).
|
||||
pass
|
||||
|
||||
|
||||
def idle_formatwarning(message, category, filename, lineno, line=None):
|
||||
"""Format warnings the IDLE way."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue