diff options
| author | Michael W. Hudson <mwh@python.net> | 2002-08-23 16:29:01 +0000 |
|---|---|---|
| committer | Michael W. Hudson <mwh@python.net> | 2002-08-23 16:29:01 +0000 |
| commit | 4437f2c301307a4b1f6de9d172069601006e6c3a (patch) | |
| tree | cb04c4ca68a472043531feea13b09d881092284f /Lib/weakref.py | |
| parent | d5fad242495d20200b86868d0ec1ebd5752a62ee (diff) | |
| download | cpython-git-4437f2c301307a4b1f6de9d172069601006e6c3a.tar.gz | |
backport gvanrossum's checkin of
revision 1.17 of weakref.py
SF patch 564549 (Erik Andersén).
The WeakKeyDictionary constructor didn't work when a dict arg was
given. Fixed by moving a line. Also adding a unit test.
Bugfix candidate.
Diffstat (limited to 'Lib/weakref.py')
| -rw-r--r-- | Lib/weakref.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py index 967458d989..bc4d0aa3bb 100644 --- a/Lib/weakref.py +++ b/Lib/weakref.py @@ -144,12 +144,12 @@ class WeakKeyDictionary(UserDict.UserDict): def __init__(self, dict=None): self.data = {} - if dict is not None: self.update(dict) def remove(k, selfref=ref(self)): self = selfref() if self is not None: del self.data[k] self._remove = remove + if dict is not None: self.update(dict) def __delitem__(self, key): for ref in self.data.iterkeys(): |
