summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2025-02-04 14:25:49 (GMT)
committerGitHub <noreply@github.com>2025-02-04 14:25:49 (GMT)
commit979d76620990e6f8d68fa63e0ae0db1ec5b4d14c (patch)
tree64194c4fb9bc31fedd871639b71278b3b6ee1c4f /Lib/pydoc.py
parent8b5c8508c7f5d98b09792e159ef2396c73da68cd (diff)
downloadcpython-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.py2
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