diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-04-23 17:26:44 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-04-23 17:26:44 (GMT) |
commit | a82c960c17f4d72ed0e41db58fc6557df40852a0 (patch) | |
tree | e053a093127344d6eadc9a2154d11bf90305611a /Lib/pydoc.py | |
parent | d4404d659c4b7d9a825571cc27707e28aa61251f (diff) | |
parent | c43125a05cc2f942ae8ba372b1dbe2e2e75d446a (diff) | |
download | cpython-a82c960c17f4d72ed0e41db58fc6557df40852a0.zip cpython-a82c960c17f4d72ed0e41db58fc6557df40852a0.tar.gz cpython-a82c960c17f4d72ed0e41db58fc6557df40852a0.tar.bz2 |
merge #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-x | Lib/pydoc.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 8b94993..b319d11 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1521,7 +1521,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): |