bpo-46434: Handle missing docstrings in pdb help (GH-30705)

This commit is contained in:
Tom Sparrow 2022-01-21 17:00:48 +00:00 committed by GitHub
parent a1bf329bca
commit 60705cff70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 0 deletions

View file

@ -1577,6 +1577,9 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.error('No help for %r; please do not run Python with -OO '
'if you need command help' % arg)
return
if command.__doc__ is None:
self.error('No help for %r; __doc__ string missing' % arg)
return
self.message(command.__doc__.rstrip())
do_h = do_help