summaryrefslogtreecommitdiffstats
path: root/Lib/test/regrtest.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-03-03 18:28:04 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-03-03 18:28:04 (GMT)
commit608c1d8e87b20116011fe8fce634e980e115d514 (patch)
treee7204b4c31d30b37d308dda03cc03c032f5df08e /Lib/test/regrtest.py
parent1f178a6fac790f380b6830642b8c9afc0a3a9931 (diff)
downloadcpython-608c1d8e87b20116011fe8fce634e980e115d514.zip
cpython-608c1d8e87b20116011fe8fce634e980e115d514.tar.gz
cpython-608c1d8e87b20116011fe8fce634e980e115d514.tar.bz2
Since abc._Abstract was replaces by a new type flags the regression test suite fails. I've added a new function inspect.isabstract(). Is the mmethod fine or should I check if object is a instance of type or subclass of object, too?
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-xLib/test/regrtest.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index b6aa96b..dfb01ba 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -129,6 +129,7 @@ import warnings
import re
import cStringIO
import traceback
+from inspect import isabstract
# I see no other way to suppress these warnings;
# putting them in test_grammar.py has no effect:
@@ -649,7 +650,6 @@ def cleanup_test_droppings(testname, verbose):
def dash_R(the_module, test, indirect_test, huntrleaks):
# This code is hackish and inelegant, but it seems to do the job.
import copy_reg, _abcoll
- from abc import _Abstract
if not hasattr(sys, 'gettotalrefcount'):
raise Exception("Tracking reference leaks requires a debug build "
@@ -661,7 +661,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 issubclass(abc, _Abstract):
+ if not isabstract(abc):
continue
for obj in abc.__subclasses__() + [abc]:
abcs[obj] = obj._abc_registry.copy()
@@ -699,7 +699,6 @@ def dash_R_cleanup(fs, ps, pic, abcs):
import _strptime, linecache, dircache
import urlparse, urllib, urllib2, mimetypes, doctest
import struct, filecmp, _abcoll
- from abc import _Abstract
from distutils.dir_util import _path_created
# Restore some original values.
@@ -714,7 +713,7 @@ def dash_R_cleanup(fs, ps, pic, abcs):
# Clear ABC registries, restoring previously saved ABC registries.
for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]:
- if not issubclass(abc, _Abstract):
+ if not isabstract(abc):
continue
for obj in abc.__subclasses__() + [abc]:
obj._abc_registry = abcs.get(obj, {}).copy()