Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[3.11] gh-98374: Suppress ImportError for invalid query for help() co…
…mmand. (gh-98450)

(cherry picked from commit 4156b2f)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
  • Loading branch information
corona10 committed Oct 20, 2022
commit 697e1fcac613b78c48e92ece96f015e77a786d53
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.