This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2020-03-24.02:01:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585015294.18.0.331099415943.issue40050@roundup.psfhosted.org>
In-reply-to
Content
Before commit 8334f30a74abcf7e469b901afc307887aa85a888, at the first _imp.create_builtin() calls, it calls _PyImport_FixupExtensionObject() which stores the created module in an internal "extensions" dictionary. PyInit__weakref() returns a module object. Next calls to _imp.create_builtin("_weakref") simply returned the cached _weakref module.

At commit 8334f30a74abcf7e469b901afc307887aa85a888, _imp.create_builtin() doesn't store it in the internal "extensions" dictionary, but calls PyModule_FromDefAndSpec() instead. PyInit__weakref() returns a module definition (PyModuleDef_Type: "moduledef"). Each _imp.create_builtin("_weakref") creates a new module.
History
Date User Action Args
2020-03-24 02:01:34vstinnersetrecipients: + vstinner
2020-03-24 02:01:34vstinnersetmessageid: <1585015294.18.0.331099415943.issue40050@roundup.psfhosted.org>
2020-03-24 02:01:34vstinnerlinkissue40050 messages
2020-03-24 02:01:34vstinnercreate