summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-06-03 08:15:04 (GMT)
committerGitHub <noreply@github.com>2024-06-03 08:15:04 (GMT)
commit4223f1d828d3a3e1c8d803e3fdd420afd7d85faf (patch)
tree9b91520883a6aecc47fb123a4e7057ed88a27509 /Lib/pydoc.py
parent1e5f615086d23c71a9701abe641b5241e4345234 (diff)
downloadcpython-4223f1d828d3a3e1c8d803e3fdd420afd7d85faf.zip
cpython-4223f1d828d3a3e1c8d803e3fdd420afd7d85faf.tar.gz
cpython-4223f1d828d3a3e1c8d803e3fdd420afd7d85faf.tar.bz2
gh-119856: Support exiting help() with just "exit" (#119858)
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r--Lib/pydoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 5d854c5..2ba597d 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -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 ("'", '"')
and request[0] not in 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':
self.intro()
else:
@@ -2059,7 +2059,7 @@ the modules whose name or summary contain a given string such as "spam",
enter "modules spam".
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]))
def list(self, items, columns=4, width=80):