mirror of https://github.com/python/cpython
gh-119856: Support exiting help() with just "exit" (#119858)
This commit is contained in:
parent
1e5f615086
commit
4223f1d828
|
@ -2007,7 +2007,7 @@ has the same effect as typing a particular string at the help> prompt.
|
||||||
if (len(request) > 2 and request[0] == request[-1] in ("'", '"')
|
if (len(request) > 2 and request[0] == request[-1] in ("'", '"')
|
||||||
and request[0] not in request[1:-1]):
|
and request[0] not in request[1:-1]):
|
||||||
request = request[1:-1]
|
request = request[1:-1]
|
||||||
if request.lower() in ('q', 'quit'): break
|
if request.lower() in ('q', 'quit', 'exit'): break
|
||||||
if request == 'help':
|
if request == 'help':
|
||||||
self.intro()
|
self.intro()
|
||||||
else:
|
else:
|
||||||
|
@ -2059,7 +2059,7 @@ the modules whose name or summary contain a given string such as "spam",
|
||||||
enter "modules spam".
|
enter "modules spam".
|
||||||
|
|
||||||
To quit this help utility and return to the interpreter,
|
To quit this help utility and return to the interpreter,
|
||||||
enter "q" or "quit".
|
enter "q", "quit" or "exit".
|
||||||
'''.format('%d.%d' % sys.version_info[:2]))
|
'''.format('%d.%d' % sys.version_info[:2]))
|
||||||
|
|
||||||
def list(self, items, columns=4, width=80):
|
def list(self, items, columns=4, width=80):
|
||||||
|
|
Loading…
Reference in New Issue