mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-45395: Make custom frozen modules additions instead of replacements. (gh-28778)
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
This commit is contained in:
parent
66e6b3dcd3
commit
074fa57506
10 changed files with 219 additions and 129 deletions
|
@ -15,6 +15,9 @@ struct _module_alias {
|
|||
const char *orig; /* ASCII encoded string */
|
||||
};
|
||||
|
||||
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenBootstrap;
|
||||
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenStdlib;
|
||||
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenTest;
|
||||
extern const struct _module_alias * _PyImport_FrozenAliases;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue