8000 bpo-40077: Convert _elementtree types to heap types by erlend-aasland · Pull Request #23428 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40077: Convert _elementtree types to heap types #23428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Prev Previous commit
Next Next commit
Create module before creating types
  • Loading branch information
Erlend E. Aasland committed Jan 11, 2021
commit 6e53e92da1f98c0376a8d135c1594fc20748e1e2
10 changes: 5 additions & 5 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4321,17 +4321,17 @@ PyInit__elementtree(void)
return m;
}

m = PyModule_Create(&elementtreemodule);
if (!m)
goto error;
st = get_elementtree_state(m);

/* Initialize object types */
CREATE_TYPE(m, ElementIter_Type, &elementiter_spec);
CREATE_TYPE(m, TreeBuilder_Type, &treebuilder_spec);
CREATE_TYPE(m, Element_Type, &element_spec);
CREATE_TYPE(m, XMLParser_Type, &xmlparser_spec);

m = PyModule_Create(&elementtreemodule);
if (!m)
goto error;
st = get_elementtree_state(m);

if (!(temp = PyImport_ImportModule("copy")))
goto error;
st->deepcopy_obj = PyObject_GetAttrString(temp, "deepcopy");
Expand Down
0