diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2021-10-28 21:04:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 21:04:33 (GMT) |
commit | 074fa5750640a067d9894c69378a00ceecc3b948 (patch) | |
tree | 9635b7a42f48ca862af8dfc3fd4721bc1218bb17 /Include | |
parent | 66e6b3dcd3bbab06feeff2cbaf8aade7b6223d6c (diff) | |
download | cpython-074fa5750640a067d9894c69378a00ceecc3b948.zip cpython-074fa5750640a067d9894c69378a00ceecc3b948.tar.gz cpython-074fa5750640a067d9894c69378a00ceecc3b948.tar.bz2 |
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
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_import.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/internal/pycore_import.h b/Include/internal/pycore_import.h index 6439b73..aee1f66 100644 --- a/Include/internal/pycore_import.h +++ b/Include/internal/pycore_import.h @@ -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 |