• Victor Stinner's avatar
    Issue #18408: Different fixes in _elementtree.c to handle correctly MemoryError · 71c8b7ec
    Victor Stinner yazdı
     * create_new_element() initializes all attributes before handling errors,
       to fix a crash in the destructor
    * create_new_element() calls PyObject_GC_Del() on error, instead of
      PyObject_Del(), because the object was created by PyObject_GC_New()
    * subelement() now handles create_new_element() failure
    * element_getattro() now handles element_get_text() failure
    * makeuniversal() now handles PyBytes_FromStringAndSize() failure
    71c8b7ec
_elementtree.c 104 KB