[3.12] gh-128772: Fix pydoc for methods with __module__ is None (GH-129177) (GH-129654)

(cherry picked from commit 979d766209)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-02-04 15:44:02 +01:00 committed by GitHub
parent 676ee57bd6
commit 0d207c3dd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 1 deletions

View file

@ -210,7 +210,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