diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-09-28 12:35:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 12:35:23 (GMT) |
commit | acd46feff3c06d3f1d00ab850e530c519445a737 (patch) | |
tree | 12a9579754df7d9167a35e66185657b5131b39fb /Lib/idlelib | |
parent | 38c67738c64304928c68d5c2bd78bbb01d979b94 (diff) | |
download | cpython-acd46feff3c06d3f1d00ab850e530c519445a737.zip cpython-acd46feff3c06d3f1d00ab850e530c519445a737.tar.gz cpython-acd46feff3c06d3f1d00ab850e530c519445a737.tar.bz2 |
bpo-45296: Fix exit/quit message on Windows (GH-28577) (GH-28600)
IDLE recognizes Ctrl-D, as on other systems, instead of Ctrl-Z.
(cherry picked from commit e649e0658ff2af87b07d994c05ae048e16e31aae)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib')
-rwxr-xr-x | Lib/idlelib/pyshell.py | 7 | ||||
-rw-r--r-- | Lib/idlelib/run.py | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 4e74400..6c333b0 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -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 diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 3836727..47c4cbd 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -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.""" |