diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 28bdf1effeb..d488f01b803 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -310,7 +310,8 @@ get_attrib_from_keywords(PyObject *kwds) /* attrib can be NULL if PyDict_New failed */ if (attrib) - PyDict_Update(attrib, kwds); + if (PyDict_Update(attrib, kwds) < 0) + return NULL; return attrib; }