diff options
-rw-r--r-- | Lib/weakref.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py index 39ec330..967458d 100644 --- a/Lib/weakref.py +++ b/Lib/weakref.py @@ -179,7 +179,11 @@ class WeakKeyDictionary(UserDict.UserDict): return self.data.get(ref(key),default) def has_key(self, key): - return self.data.has_key(ref(key)) + try: + wr = ref(key) + except TypeError: + return 0 + return self.data.has_key(wr) def items(self): L = [] |