[3.11] gh-98374: Suppress ImportError for invalid query for help() co… (gh-98472)

This commit is contained in:
Dong-hee Na 2022-10-20 11:43:21 +09:00 committed by GitHub
parent 5f5fa4ca4b
commit e2af980e19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -1998,7 +1998,10 @@ class Helper:
_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()