]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed two small problems in regrtest found by Amaury. This fixes issue #1539. Thanks...
authorChristian Heimes <christian@cheimes.de>
Wed, 5 Dec 2007 12:45:55 +0000 (12:45 +0000)
committerChristian Heimes <christian@cheimes.de>
Wed, 5 Dec 2007 12:45:55 +0000 (12:45 +0000)
Lib/test/regrtest.py

index 16f4d3d930cd4b9ab9de843a4e7dc7e85367f1ed..bd79c97be0fba213de8f13c86149d3010e77c3c6 100755 (executable)
@@ -701,7 +701,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
     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()
@@ -743,6 +743,7 @@ def dash_R_cleanup(fs, ps, pic, abcs):
     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
@@ -756,7 +757,7 @@ def dash_R_cleanup(fs, ps, pic, abcs):
         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()