File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1435,7 +1435,8 @@ def makename(c, m=object.__module__):
1435
1435
# List the built-in subclasses, if any:
1436
1436
subclasses = sorted (
1437
1437
(str (cls .__name__ ) for cls in type .__subclasses__ (object )
1438
- if not cls .__name__ .startswith ("_" ) and cls .__module__ == "builtins" ),
1438
+ if (not cls .__name__ .startswith ("_" ) and
1439
+ getattr (cls , '__module__' , '' ) == "builtins" )),
1439
1440
key = str .lower
1440
1441
)
1441
1442
no_of_subclasses = len (subclasses )
Original file line number Diff line number Diff line change @@ -556,6 +556,14 @@ class object
556
556
| ... and 82 other subclasses
557
557
"""
558
558
doc = pydoc .TextDoc ()
559
+ try :
560
+ # Make sure HeapType, which has no __module__ attribute, is one
561
+ # of the known subclasses of object. (doc.docclass() used to
562
+ # fail if HeapType was imported before running this test, like
563
+ # when running tests sequentially.)
564
+ from _testcapi import HeapType
565
+ except ImportError :
566
+ pass
559
567
text = doc .docclass (object )
560
568
snip = (" | Built-in subclasses:\n "
561
569
" | async_generator\n "
You can’t perform that action at this time.
0 commit comments