summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-19 21:05:12 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-19 21:05:12 (GMT)
commit056eb02719497a700e332d2ad69c2b11db0e3552 (patch)
tree53e0989921a0eb66d17af0ae0ab55b99280be8c0 /Lib/pydoc.py
parent4ac30f17925bc5dc283cd638a43b9ecde95b63a9 (diff)
downloadcpython-056eb02719497a700e332d2ad69c2b11db0e3552.zip
cpython-056eb02719497a700e332d2ad69c2b11db0e3552.tar.gz
cpython-056eb02719497a700e332d2ad69c2b11db0e3552.tar.bz2
Issue #20654: Fixed pydoc for enums with zero value. Patch by Vajrasky Kok.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index cf164cc..3873d55 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -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)