diff options
author | Christian Heimes <christian@cheimes.de> | 2007-12-05 12:45:55 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-12-05 12:45:55 (GMT) |
commit | 1239ad81e023db1b6c9f7510b870850428f3b97b (patch) | |
tree | 68c0875fd48b08b631c9ad2fc6d84f2d58678b90 | |
parent | 60d388d98d63c8d6a8eac51a8f0e45016bbd1cf6 (diff) | |
download | cpython-1239ad81e023db1b6c9f7510b870850428f3b97b.zip cpython-1239ad81e023db1b6c9f7510b870850428f3b97b.tar.gz cpython-1239ad81e023db1b6c9f7510b870850428f3b97b.tar.bz2 |
Fixed two small problems in regrtest found by Amaury. This fixes issue #1539. Thanks Amaury!
-rwxr-xr-x | Lib/test/regrtest.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 16f4d3d..bd79c97 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -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() |