pic = sys.path_importer_cache.copy()
abcs = {}
for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]:
- if not isinstance(abc, _Abstract):
+ if not issubclass(abc, _Abstract):
continue
for obj in abc.__subclasses__() + [abc]:
abcs[obj] = obj._abc_registry.copy()
import struct, filecmp, _abcoll
from abc import _Abstract
from distutils.dir_util import _path_created
+ from weakref import WeakSet
# Restore some original values.
warnings.filters[:] = fs
if not issubclass(abc, _Abstract):
continue
for obj in abc.__subclasses__() + [abc]:
- obj._abc_registry = abcs.get(obj, {}).copy()
+ obj._abc_registry = abcs.get(obj, WeakSet()).copy()
obj._abc_cache.clear()
obj._abc_negative_cache.clear()