summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-04-23 13:27:11 -0400
committerR David Murray <rdmurray@bitdance.com>2012-04-23 13:27:11 -0400
commitc313b1d9b0a8afe47fdd58d4685fa3d19ab79e57 (patch)
treea12e865512bc2ca67378b75c1aa0588737d5875d /Lib/pydoc.py
parent4c20c4e198b0a87f94a814d891ef18bf2d49864a (diff)
downloadcpython-git-c313b1d9b0a8afe47fdd58d4685fa3d19ab79e57.tar.gz
#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 674af6aacf..68ba21f30f 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -1498,7 +1498,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):
"""Render text documentation, given an object or a path to an object."""