Commit b136f11f authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-30892: Fix _elementtree module initialization (#2647)

Handle getattr(copy, 'deepcopy') error in _elementtree module
initialization.
parent aa8d0a24
......@@ -3990,6 +3990,11 @@ PyInit__elementtree(void)
st->deepcopy_obj = PyObject_GetAttrString(temp, "deepcopy");
Py_XDECREF(temp);
if (st->deepcopy_obj == NULL) {
return NULL;
}
assert(!PyErr_Occurred());
if (!(st->elementpath_obj = PyImport_ImportModule("xml.etree.ElementPath")))
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment