summaryrefslogtreecommitdiffstats
path: root/Tools/freeze
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-07 04:51:03 (GMT)
committerGuido van Rossum <guido@python.org>1998-03-07 04:51:03 (GMT)
commita0e18357e7b48d91710db3420097945ec5a0d03b (patch)
tree84ea9810232b6a035096f6eda1efff04dc8cee84 /Tools/freeze
parent31d53ed93c82419a9b640daa86d162a6edcdc129 (diff)
downloadcpython-a0e18357e7b48d91710db3420097945ec5a0d03b.zip
cpython-a0e18357e7b48d91710db3420097945ec5a0d03b.tar.gz
cpython-a0e18357e7b48d91710db3420097945ec5a0d03b.tar.bz2
Rearrange some stuff so that the warning for unknown modules is also
issued on Windows.
Diffstat (limited to 'Tools/freeze')
-rwxr-xr-xTools/freeze/freeze.py38
1 files changed, 21 insertions, 17 deletions
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py
index 3b58243..3de6bdb 100755
--- a/Tools/freeze/freeze.py
+++ b/Tools/freeze/freeze.py
@@ -279,22 +279,7 @@ def main():
os.unlink(frozen_c)
os.rename(backup, frozen_c)
- # windows gets different treatment
- if win:
- # Taking a shortcut here...
- import winmakemakefile
- outfp = open(makefile, 'w')
- try:
- winmakemakefile.makemakefile(outfp,
- locals(),
- [frozenmain_c,
- os.path.basename(frozen_c)],
- os.path.basename(target))
- finally:
- outfp.close()
- return
-
- # generate config.c and Makefile
+ # look for unfrozen modules (builtin and of unknown origin)
builtins = []
unknown = []
mods = dict.keys()
@@ -307,17 +292,36 @@ def main():
else:
unknown.append(mod)
+ # search for unknown modules in extensions directories (not on Windows)
addfiles = []
- if unknown:
+ if unknown and not win:
addfiles, addmods = \
checkextensions.checkextensions(unknown, extensions)
for mod in addmods:
unknown.remove(mod)
builtins = builtins + addmods
+
+ # report unknown modules
if unknown:
sys.stderr.write('Warning: unknown modules remain: %s\n' %
string.join(unknown))
+ # windows gets different treatment
+ if win:
+ # Taking a shortcut here...
+ import winmakemakefile
+ outfp = open(makefile, 'w')
+ try:
+ winmakemakefile.makemakefile(outfp,
+ locals(),
+ [frozenmain_c,
+ os.path.basename(frozen_c)],
+ os.path.basename(target))
+ finally:
+ outfp.close()
+ return
+
+ # generate config.c and Makefile
builtins.sort()
infp = open(config_c_in)
backup = config_c + '~'