FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-105922: Add PyImport_AddModuleRef() function by vstinner · Pull Request #105923 · python/cpython · GitHub

/ cpython Public

gh-105922: Add PyImport_AddModuleRef() function - #105923

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:pyimport_addmoduleref
Jun 20, 2023
Merged

gh-105922: Add PyImport_AddModuleRef() function#105923
vstinner merged 1 commit into
python:mainfrom
vstinner:pyimport_addmoduleref

Conversation

vstinner commented Jun 19, 2023
edited
Loading

Copy link
Copy Markdown
Member
  • Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and
    PyImport_AddModuleObject().
  • pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with
    PyImport_AddModuleRef(name).

📚 Documentation preview 📚: https://cpython-previews--105923.org.readthedocs.build/

erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 :(

Comment thread Include/import.h
Comment thread Python/import.c Outdated
Comment thread Python/import.c Outdated
Comment thread Python/pythonrun.c Outdated
vstinner force-pushed the pyimport_addmoduleref branch from 631c02c to bf2a756 Compare June 19, 2023 23:08

Copy link
Copy Markdown
Member Author

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

erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Small typo nit. Otherwise looks good to me.

Comment thread Doc/whatsnew/3.13.rst Outdated
* Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and
  PyImport_AddModuleObject().
* pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with
  PyImport_AddModuleRef(name).

Copy link
Copy Markdown
Member Author

I fixed the typo: similar than => similar to.

vstinner force-pushed the pyimport_addmoduleref branch from 22c5f8c to f3a223d Compare June 20, 2023 00:36
vstinner merged commit 03f1a13 into python:main Jun 20, 2023
vstinner deleted the pyimport_addmoduleref branch June 20, 2023 06:48
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL