fix crash when a command doesn't have a docstring
This commit is contained in:
parent
60638cff63
commit
c009b26864
1 changed files with 10 additions and 8 deletions
|
|
@ -418,7 +418,9 @@ class ReplApplication(Cmd, ConsoleApplication):
|
||||||
doc = getattr(self, 'do_' + command).__doc__
|
doc = getattr(self, 'do_' + command).__doc__
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return None
|
return None
|
||||||
if doc:
|
if not doc:
|
||||||
|
return '%s' % command
|
||||||
|
|
||||||
doc = '\n'.join(line.strip() for line in doc.strip().split('\n'))
|
doc = '\n'.join(line.strip() for line in doc.strip().split('\n'))
|
||||||
if not doc.startswith(command):
|
if not doc.startswith(command):
|
||||||
doc = '%s\n\n%s' % (command, doc)
|
doc = '%s\n\n%s' % (command, doc)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue