bpo-30892: Fix _elementtree module initialization (#2647)
Handle getattr(copy, 'deepcopy') error in _elementtree module initialization.
This commit is contained in:
parent
aa8d0a2469
commit
b136f11f3a
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue