Do None instead of falsy checks on Command attributes
This commit is contained in:
parent
dc8aa7c35b
commit
e1c94a3b1c
@ -718,9 +718,9 @@ class Command:
|
|||||||
If that lookup leads to an empty string then the first line of the
|
If that lookup leads to an empty string then the first line of the
|
||||||
:attr:`help` attribute is used instead.
|
:attr:`help` attribute is used instead.
|
||||||
"""
|
"""
|
||||||
if self.brief:
|
if self.brief is not None:
|
||||||
return self.brief
|
return self.brief
|
||||||
if self.help:
|
if self.help is not None:
|
||||||
return self.help.split('\n', 1)[0]
|
return self.help.split('\n', 1)[0]
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
@ -739,7 +739,7 @@ class Command:
|
|||||||
name = self.name if not parent else parent + ' ' + self.name
|
name = self.name if not parent else parent + ' ' + self.name
|
||||||
result.append(name)
|
result.append(name)
|
||||||
|
|
||||||
if self.usage:
|
if self.usage is not None:
|
||||||
result.append(self.usage)
|
result.append(self.usage)
|
||||||
return ' '.join(result)
|
return ' '.join(result)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user