diff options
-rw-r--r-- | Objects/dictobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 42e270e..9398d0d 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -809,8 +809,8 @@ dict_update(register dictobject *mp, PyObject *args) dictentry *entry; if (!PyArg_Parse(args, "O!", &PyDict_Type, &other)) return NULL; - if (other == mp) - goto done; /* a.update(a); nothing to do */ + if (other == mp || other->ma_used == 0) + goto done; /* a.update(a) or a.update({}); nothing to do */ /* Do one big resize at the start, rather than incrementally resizing as we insert new items. Expect that there will be no (or few) overlapping keys. */ |