Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04a4eb3

Browse files
committed
abc's are subclasses of _Abstract, not instances.
1 parent 941973a commit 04a4eb3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/regrtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
701701
pic = sys.path_importer_cache.copy()
702702
abcs = {obj: obj._abc_registry.copy()
703703
for abc in [getattr(_abcoll, a) for a in _abcoll.__all__
704-
if isinstance(getattr(_abcoll, a), _Abstract)]
704+
if issubclass(getattr(_abcoll, a), _Abstract)]
705705
for obj in abc.__subclasses__() + [abc]}
706706

707707
if indirect_test:
@@ -751,7 +751,7 @@ def dash_R_cleanup(fs, ps, pic, abcs):
751751

752752
# Clear ABC registries, restoring previously saved ABC registries.
753753
for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]:
754-
if not isinstance(abc, _Abstract):
754+
if not issubclass(abc, _Abstract):
755755
continue
756756
for obj in abc.__subclasses__() + [abc]:
757757
obj._abc_registry = abcs.get(obj, {}).copy()

0 commit comments

Comments
 (0)