summaryrefslogtreecommitdiff
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-02 19:42:39 +0000
committerGuido van Rossum <guido@python.org>1995-01-02 19:42:39 +0000
commit5ba088b4a196e692453dc74717247a0d70314ee3 (patch)
tree7ff9b5611f3fa3e0f70b0e7cd9137ff426c3c92b /Objects/dictobject.c
parent6a06edf0559e6b5bc4ba0a1f29f84bcef1b910eb (diff)
downloadcpython-5ba088b4a196e692453dc74717247a0d70314ee3.tar.gz
* Objects/mappingobject.c (mappingremove): don't call
lookmapping() for empty dictionary
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 89fd314ef4..bb4e051b1c 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -322,8 +322,11 @@ mappingremove(op, key)
if (hash == -1)
return -1;
mp = (mappingobject *)op;
+ if (((mappingobject *)op)->ma_table == NULL)
+ goto empty;
ep = lookmapping(mp, key, hash);
if (ep->me_value == NULL) {
+ empty:
err_setval(KeyError, key);
return -1;
}