From 056eb02719497a700e332d2ad69c2b11db0e3552 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 19 Feb 2014 23:05:12 +0200 Subject: Issue #20654: Fixed pydoc for enums with zero value. Patch by Vajrasky Kok. --- Lib/pydoc.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Lib/pydoc.py') diff --git a/Lib/pydoc.py b/Lib/pydoc.py index cf164ccfca..3873d5554a 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) -- cgit v1.2.1