diff --git a/Objects/listobject.c b/Objects/listobject.c index 470ad8eb813..472c471d996 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1374,6 +1374,11 @@ _list_extend(PyListObject *self, PyObject *iterable) res = list_extend_set(self, (PySetObject *)iterable); Py_END_CRITICAL_SECTION2(); } + else if (PyDict_CheckExact(iterable)) { + Py_BEGIN_CRITICAL_SECTION2(self, iterable); + res = list_extend_dict(self, (PyDictObject *)iterable, 0 /*keys*/); + Py_END_CRITICAL_SECTION2(); + } else if (Py_IS_TYPE(iterable, &PyDictKeys_Type)) { PyDictObject *dict = ((_PyDictViewObject *)iterable)->dv_dict; Py_BEGIN_CRITICAL_SECTION2(self, dict);