Skip to content

Commit e2af980

Browse files
authored
[3.11] gh-98374: Suppress ImportError for invalid query for help() co… (gh-98472)
1 parent 5f5fa4c commit e2af980

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Lib/pydoc.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,10 @@ def __repr__(self):
19981998
_GoInteractive = object()
19991999
def __call__(self, request=_GoInteractive):
20002000
if request is not self._GoInteractive:
2001-
self.help(request)
2001+
try:
2002+
self.help(request)
2003+
except ImportError as e:
2004+
self.output.write(f'{e}\n')
20022005
else:
20032006
self.intro()
20042007
self.interact()
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)