diff options
Diffstat (limited to 'Lib/weakref.py')
-rw-r--r-- | Lib/weakref.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py index 838ff5e..09bed65 100644 --- a/Lib/weakref.py +++ b/Lib/weakref.py @@ -164,11 +164,7 @@ class WeakKeyDictionary(UserDict.UserDict): if dict is not None: self.update(dict) def __delitem__(self, key): - for ref in self.data.iterkeys(): - o = ref() - if o == key: - del self.data[ref] - return + del self.data[ref(key)] def __getitem__(self, key): return self.data[ref(key)] |