]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-119856: Support exiting help() with just "exit" (#119858)
authorVictor Stinner <vstinner@python.org>
Mon, 3 Jun 2024 08:15:04 +0000 (10:15 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Jun 2024 08:15:04 +0000 (10:15 +0200)
Lib/pydoc.py

index 5d854c50f40d6e672d4d8aa0831fae592f23c9cf..2ba597d01f245eb02ae1b36d4f0c3e152bab0dae 100644 (file)
@@ -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):