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 _functools initialization.
  • Loading branch information
brandtbucher committed Jan 28, 2020
commit b1fb2760a527c3db3418a7c6d54d4f21cf8c8eba
5 changes: 4 additions & 1 deletion Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,10 @@ PyInit__functools(void)
}
name = _PyType_Name(typelist[i]);
Py_INCREF(typelist[i]);
PyModule_AddObject(m, name, (PyObject *)typelist[i]);
if (_PyModule_StealObject(m, name, (PyObject *)typelist[i]) < 0) {
Py_DECREF(m);
return NULL;
}
}
return m;
}
0