Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1417712

Browse files
authored
Add advice how to freeze fewer modules (#101298)
(And fix a bug that only occurs when you follow the advice.)
1 parent 395871e commit 1417712

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tools/build/freeze_modules.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
OS_PATH = 'ntpath' if os.name == 'nt' else 'posixpath'
3333

3434
# These are modules that get frozen.
35+
# If you're debugging new bytecode instructions,
36+
# you can delete all sections except 'import system'.
37+
# This also speeds up building somewhat.
3538
TESTS_SECTION = 'Test module'
3639
FROZEN = [
3740
# See parse_frozen_spec() for the format.
@@ -45,6 +48,7 @@
4548
# on a builtin zip file instead of a filesystem.
4649
'zipimport',
4750
]),
51+
# (You can delete entries from here down to the end of the list.)
4852
('stdlib - startup, without site (python -S)', [
4953
'abc',
5054
'codecs',
@@ -80,6 +84,7 @@
8084
'<__phello__.**.*>',
8185
f'frozen_only : __hello_only__ = {FROZEN_ONLY}',
8286
]),
87+
# (End of stuff you could delete.)
8388
]
8489
BOOTSTRAP = {
8590
'importlib._bootstrap',
@@ -520,7 +525,7 @@ def regen_frozen(modules, frozen_modules: bool):
520525

521526
for lines in (bootstraplines, stdliblines, testlines):
522527
# TODO: Is this necessary any more?
523-
if not lines[0]:
528+
if lines and not lines[0]:
524529
del lines[0]
525530
for i, line in enumerate(lines):
526531
if line:

0 commit comments

Comments
 (0)