diff options
author | Guido van Rossum <guido@python.org> | 1995-01-02 19:42:39 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-01-02 19:42:39 +0000 |
commit | 5ba088b4a196e692453dc74717247a0d70314ee3 (patch) | |
tree | 7ff9b5611f3fa3e0f70b0e7cd9137ff426c3c92b /Objects/dictobject.c | |
parent | 6a06edf0559e6b5bc4ba0a1f29f84bcef1b910eb (diff) | |
download | cpython-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.c | 3 |
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; } |