cmdutils: Use inspect.getdoc
This commit is contained in:
parent
fea3524443
commit
ef31157f5e
@ -225,8 +225,9 @@ class register: # pylint: disable=invalid-name
|
|||||||
raise ValueError("{} is a class method, but instance was not "
|
raise ValueError("{} is a class method, but instance was not "
|
||||||
"given!".format(self.name[0]))
|
"given!".format(self.name[0]))
|
||||||
has_count = 'count' in signature.parameters
|
has_count = 'count' in signature.parameters
|
||||||
if self.func.__doc__ is not None:
|
doc = inspect.getdoc(self.func)
|
||||||
desc = self.func.__doc__.splitlines()[0].strip()
|
if doc is not None:
|
||||||
|
desc = doc.splitlines()[0].strip()
|
||||||
else:
|
else:
|
||||||
desc = ""
|
desc = ""
|
||||||
if not self.ignore_args:
|
if not self.ignore_args:
|
||||||
|
Loading…
Reference in New Issue
Block a user