mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Add advice how to freeze fewer modules (#101298)
(And fix a bug that only occurs when you follow the advice.)
This commit is contained in:
parent
395871e511
commit
1417712812
1 changed files with 6 additions and 1 deletions
|
@ -32,6 +32,9 @@ PCBUILD_PYTHONCORE = os.path.join(ROOT_DIR, 'PCbuild', 'pythoncore.vcxproj')
|
|||
OS_PATH = 'ntpath' if os.name == 'nt' else 'posixpath'
|
||||
|
||||
# These are modules that get frozen.
|
||||
# If you're debugging new bytecode instructions,
|
||||
# you can delete all sections except 'import system'.
|
||||
# This also speeds up building somewhat.
|
||||
TESTS_SECTION = 'Test module'
|
||||
FROZEN = [
|
||||
# See parse_frozen_spec() for the format.
|
||||
|
@ -45,6 +48,7 @@ FROZEN = [
|
|||
# on a builtin zip file instead of a filesystem.
|
||||
'zipimport',
|
||||
]),
|
||||
# (You can delete entries from here down to the end of the list.)
|
||||
('stdlib - startup, without site (python -S)', [
|
||||
'abc',
|
||||
'codecs',
|
||||
|
@ -80,6 +84,7 @@ FROZEN = [
|
|||
'<__phello__.**.*>',
|
||||
f'frozen_only : __hello_only__ = {FROZEN_ONLY}',
|
||||
]),
|
||||
# (End of stuff you could delete.)
|
||||
]
|
||||
BOOTSTRAP = {
|
||||
'importlib._bootstrap',
|
||||
|
@ -520,7 +525,7 @@ def regen_frozen(modules, frozen_modules: bool):
|
|||
|
||||
for lines in (bootstraplines, stdliblines, testlines):
|
||||
# TODO: Is this necessary any more?
|
||||
if not lines[0]:
|
||||
if lines and not lines[0]:
|
||||
del lines[0]
|
||||
for i, line in enumerate(lines):
|
||||
if line:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue