mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of frozen modules. (gh-28320)
Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file. This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now. https://bugs.python.org/issue45020
This commit is contained in:
parent
1aaa859497
commit
a65c86889e
16 changed files with 359 additions and 117 deletions
|
|
@ -480,6 +480,12 @@ Miscellaneous options
|
|||
objects and pyc files are desired as well as supressing the extra visual
|
||||
location indicators when the interpreter displays tracebacks. See also
|
||||
:envvar:`PYTHONNODEBUGRANGES`.
|
||||
* ``-X frozen_modules`` determines whether or not frozen modules are
|
||||
ignored by the import machinery. A value of "on" means they get
|
||||
imported and "off" means they are ignored. The default is "on"
|
||||
for non-debug builds (the normal case) and "off" for debug builds.
|
||||
Note that the "importlib_bootstrap" and "importlib_bootstrap_external"
|
||||
frozen modules are always used, even if this flag is set to "off".
|
||||
|
||||
It also allows passing arbitrary values and retrieving them through the
|
||||
:data:`sys._xoptions` dictionary.
|
||||
|
|
@ -518,6 +524,9 @@ Miscellaneous options
|
|||
.. versionadded:: 3.11
|
||||
The ``-X no_debug_ranges`` option.
|
||||
|
||||
.. versionadded:: 3.11
|
||||
The ``-X frozen_modules`` option.
|
||||
|
||||
|
||||
Options you shouldn't use
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue