]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-119856: Support exiting help() with just "exit" (GH-119858) (#119967)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 3 Jun 2024 09:10:39 +0000 (11:10 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Jun 2024 09:10:39 +0000 (09:10 +0000)
gh-119856: Support exiting help() with just "exit" (GH-119858)
(cherry picked from commit 4223f1d828d3a3e1c8d803e3fdd420afd7d85faf)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/pydoc.py

index 55ccf2152c26cb1aa27f69d8d4fb154ff281a711..922e7fb42d83324b0ac8f35d2eec6272935c4300 100755 (executable)
@@ -2008,7 +2008,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:
@@ -2060,7 +2060,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):