Message402678
On Windows:
>>> exit
'Use exit() or Ctrl-Z plus Return to exit'
>>> quit
'Use quit() or Ctrl-Z plus Return to exit'
>>> exit.eof
'Ctrl-Z plus Return'
On *nix, 'Ctrl-Z plus Return' is 'Ctrl-D (i.e, EOF)'
IDLE uses the latter even on Windows, and Ctrl-Z does not work.
Both exit and quit are instances of _sitebuiltins.Quitter
https://github.com/python/cpython/blob/e14d5ae5447ae28fc4828a9cee8e9007f9c30700/Lib/_sitebuiltins.py#L13-L26
class Quitter(object):
def __init__(self, name, eof):
self.name = name
self.eof = eof
def __repr__(self):
return 'Use %s() or %s to exit' % (self.name, self.eof)
def __call__ [not relevant here]
We just need to replace current exit/quit.eof as indicated above on startup. |
|
Date |
User |
Action |
Args |
2021-09-26 20:52:27 | terry.reedy | set | recipients:
+ terry.reedy |
2021-09-26 20:52:27 | terry.reedy | set | messageid: <1632689547.92.0.46019643965.issue45296@roundup.psfhosted.org> |
2021-09-26 20:52:27 | terry.reedy | link | issue45296 messages |
2021-09-26 20:52:27 | terry.reedy | create | |
|