]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix _dump_registry() to use the correct prefix for the private
authorGuido van Rossum <guido@python.org>
Sat, 18 Aug 2007 00:08:26 +0000 (00:08 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 18 Aug 2007 00:08:26 +0000 (00:08 +0000)
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).

Lib/abc.py

index 07836e631ba69b0559edc6e1bd901f8863df8b3c..11ddab229f0b23ba923b49cdb263da72780e9711 100644 (file)
@@ -157,7 +157,7 @@ class ABCMeta(type):
         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 @@ class ABCMeta(type):
         # 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