◐ Shell
reader mode source ↗
Skip to content

gh-105927: PyImport_AddModule() uses _PyWeakref_GET_REF()#106001

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:getref_add_module
Jun 22, 2023
Merged

gh-105927: PyImport_AddModule() uses _PyWeakref_GET_REF()#106001
vstinner merged 1 commit into
python:mainfrom
vstinner:getref_add_module

Conversation

@vstinner

@vstinner vstinner commented Jun 22, 2023

Copy link
Copy Markdown
Member

It now raises an exception if sys.modules doesn't hold a strong reference to the module.

Elaborate the comment explaining why a weak reference is used to create a borrowed reference.

It now raises an exception if sys.modules doesn't hold a strong
reference to the module.

Elaborate the comment explaining why a weak reference is used to
create a borrowed reference.
@vstinner vstinner force-pushed the getref_add_module branch from 60ebd65 to 341d2a0 Compare June 22, 2023 22:17
@vstinner vstinner merged commit ee52158 into python:main Jun 22, 2023
@vstinner vstinner deleted the getref_add_module branch June 22, 2023 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants