gh-105922: Add PyImport_AddModuleRef() function by vstinner · Pull Request #105923 · python/cpython
Conversation
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice; I left some comments.
Too bad we cannot run the ref leak bots now; there's already a ref leak in test_import and test_peg_generator that has not been resolved :(
I updated my PR:
- Rebased on the merged pythonrunc.c refactoring: commit a5c2ad0
- Don't deprecate PyImport_AddModule() and PyImport_AddModuleObject() in this PR anymore: I prefer to handle this in a separated PR.
- Fix pythonrun.c
- Use PyImport_AddModuleRef() for
_frozen_importlib
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small typo nit. Otherwise looks good to me.
* Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and PyImport_AddModuleObject(). * pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with PyImport_AddModuleRef(name).
vstinner
deleted the
pyimport_addmoduleref
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters