[Python-3000-checkins] r57170 - python/branches/py3k/Lib/abc.py

guido.van.rossum python-3000-checkins at python.org
Sat Aug 18 02:08:52 CEST 2007


Author: guido.van.rossum
Date: Sat Aug 18 02:08:26 2007
New Revision: 57170

Modified:
   python/branches/py3k/Lib/abc.py
Log:
Fix _dump_registry() to use the correct prefix for the private
methods.  Reset the negative cache *before* resetting the invalidation
counter, hoping this may plug a race condition (but then again, this
whole module isn't coded to be thread-safe).


Modified: python/branches/py3k/Lib/abc.py
==============================================================================
--- python/branches/py3k/Lib/abc.py	(original)
+++ python/branches/py3k/Lib/abc.py	Sat Aug 18 02:08:26 2007
@@ -157,7 +157,7 @@
         print("Class: %s.%s" % (cls.__module__, cls.__name__), file=file)
         print("Inv.counter: %s" % ABCMeta.__invalidation_counter, file=file)
         for name in sorted(cls.__dict__.keys()):
-            if name.startswith("__abc_"):
+            if name.startswith("_ABCMeta__"):
                 value = getattr(cls, name)
                 print("%s: %r" % (name, value), file=file)
 
@@ -174,8 +174,8 @@
         # Check negative cache; may have to invalidate
         if cls.__negative_cache_version < ABCMeta.__invalidation_counter:
             # Invalidate the negative cache
-            cls.__negative_cache_version = ABCMeta.__invalidation_counter
             cls.__negative_cache = set()
+            cls.__negative_cache_version = ABCMeta.__invalidation_counter
         elif subclass in cls.__negative_cache:
             return False
         # Check the subclass hook


More information about the Python-3000-checkins mailing list