bpo-45395: Make custom frozen modules additions instead of replacements.#28778
bpo-45395: Make custom frozen modules additions instead of replacements.#28778ericsnowcurrently merged 11 commits intopython:mainpython/cpython:mainfrom ericsnowcurrently:frozen-modules-custom-additionsericsnowcurrently/cpython:frozen-modules-custom-additionsCopy head branch name to clipboard
Conversation
|
Same comment as for #28776 -- do we have any examples of apps that actually use this feature? Would they benefit from this change? |
|
I don't have examples, other than that |
|
Aha, so then we should just make sure that Tools/freeze still works. :-) |
87b8b98 to
600d521
Compare
Currently custom modules (the array set on
PyImport_FrozenModules) replace all the frozen stdlib modules. That can be problematic and is unlikely to be what the user wants. This change treats the custom frozen modules as additions instead. They take precedence over all other frozen modules except for those needed to bootstrap the import system. If the "code" field of an entry in the custom array is NULL then that frozen module is treated as disabled, which allows a custom entry to disable a frozen stdlib module.This change allows us to get rid of
is_essential_frozen_module()and simplifies the logic for which frozen modules should be ignored.https://bugs.python.org/issue45395