Mercurial > cpython-lru_cache-weakref
diff Objects/mappingobject.c @ 2056:aff5d7d06735 legacy-trunk
* Objects/mappingobject.c (mappingremove): don't call
lookmapping() for empty dictionary
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 02 Jan 1995 19:42:39 +0000 |
| parents | de49d49044d7 |
| children | 866c81068dbd |
line wrap: on
line diff
--- a/Objects/mappingobject.c Mon Jan 02 19:30:30 1995 +0000 +++ b/Objects/mappingobject.c Mon Jan 02 19:42:39 1995 +0000 @@ -322,8 +322,11 @@ 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; }
