pygame-ce
pygame-ce copied to clipboard
Replace AddObject() with AddObjectRef()
Since Python 3.13 PyModule_AddObject() is soft deprecated. This PR replaces it with newer function, PyModule_AddObjectRef(). It was changed following the way adviced in the official documentation between versions 3.9 <-> 3.14
It's also confusing to see replacements for things that didn't previously have an incref.
It's also confusing to see replacements for things that didn't previously have an incref.
Yea you are right, that comment is mostly for encapsulate_api, and in the current master if I print Py_REFCNT of apiobj, it is 1. However, after this PR it is indeed 2 like you said. I will remove it from those places, and use it only when we actually increase the ref