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>
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 @@
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."""