8000 bpo-38823: Add a private _PyModule_StealObject API. by brandtbucher · Pull Request #17298 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-38823: Add a private _PyModule_StealObject API. #17298

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
Closed
Prev Previous commit
Next Next commit
Clean up refleaks in _warnings initialization.
  • Loading branch information
brandtbucher committed Jan 28, 2020
commit 418d79bdcdcb3e59adcb5737f7bbf859b59c0bcb
6 changes: 3 additions & 3 deletions Python/_warnings.c
Original file line number Diff line number Diff line change
Expand Up @@ -1353,17 +1353,17 @@ _PyWarnings_Init(void)
}

Py_INCREF(st->filters);
if (PyModule_AddObject(m, "filters", st->filters) < 0) {
if (_PyModule_StealObject(m, "filters", st->filters) < 0) {
goto error;
}

Py_INCREF(st->once_registry);
if (PyModule_AddObject(m, "_onceregistry", st->once_registry) < 0) {
if (_PyModule_StealObject(m, "_onceregistry", st->once_registry) < 0) {
goto error;
}

Py_INCREF(st->default_action);
if (PyModule_AddObject(m, "_defaultaction", st->default_action) < 0) {
if (_PyModule_StealObject(m, "_defaultaction", st->default_action) < 0) {
goto error;
}

Expand Down
0