[Python-3000-checkins] r56013 - python/branches/p3yk/Lib/test/regrtest.py

neal.norwitz python-3000-checkins at python.org
Mon Jun 18 04:56:34 CEST 2007


Author: neal.norwitz
Date: Mon Jun 18 04:56:31 2007
New Revision: 56013

Modified:
   python/branches/p3yk/Lib/test/regrtest.py
Log:
This should make it a little easier when adding new collections which use ABCs.
The new subclass won't need to be listed in regrtest.
It will be even better when Guido adds weakrefs. :-)


Modified: python/branches/p3yk/Lib/test/regrtest.py
==============================================================================
--- python/branches/p3yk/Lib/test/regrtest.py	(original)
+++ python/branches/p3yk/Lib/test/regrtest.py	Mon Jun 18 04:56:31 2007
@@ -708,10 +708,11 @@
     sys.path_importer_cache.update(pic)
 
     # Clear ABC registries.
-    for obj in [getattr(_abcoll, a) for a in _abcoll.__all__] + [os.environ]:
-        obj._ABCMeta__registry.clear()
-        obj._ABCMeta__cache.clear()
-        obj._ABCMeta__negative_cache.clear()
+    for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]:
+        for obj in abc.__subclasses__() + [abc]:
+            obj._ABCMeta__registry.clear()
+            obj._ABCMeta__cache.clear()
+            obj._ABCMeta__negative_cache.clear()
 
     # Clear assorted module caches.
     _path_created.clear()


More information about the Python-3000-checkins mailing list