summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-04-23 17:23:57 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-04-23 17:23:57 (GMT)
commitc43125a05cc2f942ae8ba372b1dbe2e2e75d446a (patch)
treef93bb56c150958e958682b48c6aabdf66e22359b /Lib/pydoc.py
parent88ec6209cfd0c691df596f681144e1e7c5206dd9 (diff)
downloadcpython-c43125a05cc2f942ae8ba372b1dbe2e2e75d446a.zip
cpython-c43125a05cc2f942ae8ba372b1dbe2e2e75d446a.tar.gz
cpython-c43125a05cc2f942ae8ba372b1dbe2e2e75d446a.tar.bz2
#14638: pydoc now treats non-str __name__ as None instead of raising
Original patch by Peter Otten.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 89fd09b..37616fb 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1525,7 +1525,8 @@ def resolve(thing, forceload=0):
raise ImportError('no Python documentation found for %r' % thing)
return object, thing
else:
- return thing, getattr(thing, '__name__', None)
+ name = getattr(thing, '__name__', None)
+ return thing, name if isinstance(name, str) else None
def render_doc(thing, title='Python Library Documentation: %s', forceload=0,
renderer=None):