Petr Viktorin <encu...@gmail.com> added the comment:

Since https://github.com/python/cpython/pull/23122, there is 
PyModule_AddObjectRef doesn't steal a reference.
PyModule_AddObject is discouraged in the docs, but not formally deprecated. (As 
Stefan notes, the leaks are single references in case of a module 
initialization failure -- the cost of using the API incorrectly is very small; 
requiring everyone to change their code because it was possible to misuse it is 
overkill.)

See https://docs.python.org/3.10/c-api/module.html#c.PyModule_AddObjectRef

I think this is enough to close the issue.

----------
nosy: +petr.viktorin
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue26871>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to