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__):
14351435 # List the built-in subclasses, if any:
14361436 subclasses = sorted (
14371437 (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" )),
14391440 key = str .lower
14401441 )
14411442 no_of_subclasses = len (subclasses )
Original file line number Diff line number Diff line change @@ -556,6 +556,14 @@ class object
556556 | ... and 82 other subclasses
557557 """
558558 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
559567 text = doc .docclass (object )
560568 snip = (" | Built-in subclasses:\n "
561569 " | async_generator\n "
You can’t perform that action at this time.
0 commit comments