mirror of
https://github.com/python/cpython.git
synced 2025-08-23 02:04:56 +00:00
gh-128772: Fix pydoc for methods with __module__ is None (GH-129177)
This commit is contained in:
parent
8b5c8508c7
commit
979d766209
4 changed files with 16 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue