summaryrefslogtreecommitdiff
path: root/Lib/abc.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-18 00:08:26 +0000
committerGuido van Rossum <guido@python.org>2007-08-18 00:08:26 +0000
commitd6f80bd61fab58dd3e6ff6abb823debe33e4c6db (patch)
tree8ce70b37e027a1c327eb075e1d1cd0c15311b4bc /Lib/abc.py
parenta8773c87e44a83228c2fc3ab17955752bb4b87b8 (diff)
downloadcpython-d6f80bd61fab58dd3e6ff6abb823debe33e4c6db.tar.gz
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).
Diffstat (limited to 'Lib/abc.py')
-rw-r--r--Lib/abc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/abc.py b/Lib/abc.py
index 07836e631b..11ddab229f 100644
--- a/Lib/abc.py
+++ b/Lib/abc.py
@@ -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