Skip to content

Commit a4d5b80

Browse files
committed
pythongh-98374: Suppress ImportError for invalid query for help() command.
1 parent 7b48d02 commit a4d5b80

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Lib/pydoc.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,11 @@ def __repr__(self):
19971997
_GoInteractive = object()
19981998
def __call__(self, request=_GoInteractive):
19991999
if request is not self._GoInteractive:
2000-
self.help(request)
2000+
try:
2001+
self.help(request)
2002+
except ImportError as e:
2003+
self.output.write(str(e))
2004+
self.output.write("\n")
20012005
else:
20022006
self.intro()
20032007
self.interact()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Suppress ImportError for invalid query for help() command. Patch by Dong-hee
2+
Na.

0 commit comments

Comments
 (0)