diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2025-02-04 14:25:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-04 14:25:49 (GMT) |
commit | 979d76620990e6f8d68fa63e0ae0db1ec5b4d14c (patch) | |
tree | 64194c4fb9bc31fedd871639b71278b3b6ee1c4f /Lib/pydoc.py | |
parent | 8b5c8508c7f5d98b09792e159ef2396c73da68cd (diff) | |
download | cpython-979d76620990e6f8d68fa63e0ae0db1ec5b4d14c.zip cpython-979d76620990e6f8d68fa63e0ae0db1ec5b4d14c.tar.gz cpython-979d76620990e6f8d68fa63e0ae0db1ec5b4d14c.tar.bz2 |
gh-128772: Fix pydoc for methods with __module__ is None (GH-129177)
Diffstat (limited to 'Lib/pydoc.py')
-rw-r--r-- | Lib/pydoc.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 922946e..1839b88 100644 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -245,7 +245,7 @@ def parentname(object, modname): if necessary) or module.""" if '.' in object.__qualname__: name = object.__qualname__.rpartition('.')[0] - if object.__module__ != modname: + if object.__module__ != modname and object.__module__ is not None: return object.__module__ + '.' + name else: return name |