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

Skip to content

gh-92123: Convert _elementtree types to heap types #99221

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

Merged
merged 22 commits into from
Jan 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review: fix error handling in module init
  • Loading branch information
erlend-aasland committed Jan 19, 2023
commit 730e5d25bc9f3cbd7ca89b2d67dcb68d0240a457
18 changes: 9 additions & 9 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4266,41 +4266,41 @@ PyInit__elementtree(void)

st->str_append = PyUnicode_InternFromString("append");
if (st->str_append == NULL) {
return NULL;
goto error;
}
st->str_find = PyUnicode_InternFromString("find");
if (st->str_find == NULL) {
return NULL;
goto error;
}
st->str_findall = PyUnicode_InternFromString("findall");
if (st->str_findall == NULL) {
return NULL;
goto error;
}
st->str_findtext = PyUnicode_InternFromString("findtext");
if (st->str_findtext == NULL) {
return NULL;
goto error;
}
st->str_iterfind = PyUnicode_InternFromString("iterfind");
if (st->str_iterfind == NULL) {
return NULL;
goto error;
}
st->str_tail = PyUnicode_InternFromString("tail");
if (st->str_tail == NULL) {
return NULL;
goto error;
}
st->str_text = PyUnicode_InternFromString("text");
if (st->str_text == NULL) {
return NULL;
goto error;
}
st->str_doctype = PyUnicode_InternFromString("doctype");
if (st->str_doctype == NULL) {
return NULL;
goto error;
}
st->parseerror_obj = PyErr_NewException(
"xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL
);
if (PyModule_AddObjectRef(m, "ParseError", st->parseerror_obj) < 0) {
return NULL;
goto error;
}

PyTypeObject *types[] = {
Expand Down
0