mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #20654: Fixed pydoc for enums with zero value. Patch by Vajrasky Kok.
This commit is contained in:
parent
4ac30f1792
commit
056eb02719
3 changed files with 18 additions and 3 deletions
|
@ -1244,9 +1244,12 @@ location listed above.
|
|||
doc = getdoc(value)
|
||||
else:
|
||||
doc = None
|
||||
push(self.docother(
|
||||
getattr(object, name, None) or homecls.__dict__[name],
|
||||
name, mod, maxlen=70, doc=doc) + '\n')
|
||||
try:
|
||||
obj = getattr(object, name)
|
||||
except AttributeError:
|
||||
obj = homecls.__dict__[name]
|
||||
push(self.docother(obj, name, mod, maxlen=70, doc=doc) +
|
||||
'\n')
|
||||
return attrs
|
||||
|
||||
attrs = [(name, kind, cls, value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue