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

Skip to content

Commit 94ce0d1

Browse files
committed
Add special handling for Python modules that are imported implicitly
by the Python runtime: 'site' and 'exceptions'.
1 parent c5d2d51 commit 94ce0d1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Tools/freeze/freeze.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def main():
8585
odir = ''
8686
win = sys.platform[:3] == 'win'
8787

88+
# modules that are imported by the Python runtime
89+
implicits = ["site", "exceptions"]
90+
8891
# output files
8992
frozen_c = 'frozen.c'
9093
config_c = 'config.c'
@@ -217,6 +220,9 @@ def main():
217220
target = os.path.join(odir, target)
218221
makefile = os.path.join(odir, makefile)
219222

223+
for mod in implicits:
224+
modules.append(findmodules.findmodule(mod))
225+
220226
# Actual work starts here...
221227

222228
dict = findmodules.findmodules(scriptfile, modules, path)

0 commit comments

Comments
 (0)