summaryrefslogtreecommitdiffstats
path: root/Lib/weakref.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-08-03 04:11:27 (GMT)
committerFred Drake <fdrake@acm.org>2001-08-03 04:11:27 (GMT)
commit4fd06e0170aa75e4873b73f733bfd3f3de19d967 (patch)
treefc63ca7a172058454f2354727e6b17c16fb635c1 /Lib/weakref.py
parent5d548796474d63db729903cd67a21e0a9f1e6666 (diff)
downloadcpython-4fd06e0170aa75e4873b73f733bfd3f3de19d967.zip
cpython-4fd06e0170aa75e4873b73f733bfd3f3de19d967.tar.gz
cpython-4fd06e0170aa75e4873b73f733bfd3f3de19d967.tar.bz2
Make sure that WeakValueDictionary[] raises KeyError instead of TypeError
for keys that are not in the dictionary.
Diffstat (limited to 'Lib/weakref.py')
-rw-r--r--Lib/weakref.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py
index cf950ba..1d21e79 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -41,7 +41,7 @@ class WeakValueDictionary(UserDict.UserDict):
# way in).
def __getitem__(self, key):
- o = self.data.get(key)()
+ o = self.data[key]()
if o is None:
raise KeyError, key
else: