Skip to content

Commit 4156b2f

Browse files
authored
gh-98374: Suppress ImportError for invalid query for help() command. (gh-98450)
1 parent 1ca6647 commit 4156b2f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/pydoc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,10 @@ 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(f'{e}\n')
20012004
else:
20022005
self.intro()
20032006
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)