Skip to content

Commit

Permalink
[3.11] pythongh-98374: Suppress ImportError for invalid query for hel…
Browse files Browse the repository at this point in the history
…p() command. (pythongh-98450)

(cherry picked from commit 4156b2f)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
  • Loading branch information
corona10 committed Oct 20, 2022
1 parent 5f5fa4c commit 697e1fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,10 @@ def __repr__(self):
_GoInteractive = object()
def __call__(self, request=_GoInteractive):
if request is not self._GoInteractive:
self.help(request)
try:
self.help(request)
except ImportError as e:
self.output.write(f'{e}\n')
else:
self.intro()
self.interact()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Suppress ImportError for invalid query for help() command. Patch by Dong-hee
Na.

0 comments on commit 697e1fc

Please sign in to comment.