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
Use PyModule_AddObjectRef
  • Loading branch information
Erlend E. Aasland committed Jan 11, 2021
commit 404b398d69313a941b1dae753613f8066f00f4bd
5 changes: 3 additions & 2 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4366,7 +4366,9 @@ PyInit__elementtree(void)
"xml.etree.ElementTree.ParseError", PyExc_SyntaxError, NULL
);
Py_INCREF(st->parseerror_obj);
if (PyModule_AddObject(m, "ParseError", st->parseerror_obj) < 0) {
int res = PyModule_AddObjectRef(m, "ParseError", st->parseerror_obj);
Py_DECREF(st->parseerror_obj);
if (res < 0) {
goto error;
}

Expand All @@ -4385,7 +4387,6 @@ PyInit__elementtree(void)
return m;

error:
Py_XDECREF(st->parseerror_obj);
Py_XDECREF(m);
return NULL;
}
0