diff options
author | Georg Brandl <georg@python.org> | 2010-08-02 22:25:16 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-08-02 22:25:16 (GMT) |
commit | 0063958c2ed210a0d70da2ab26f660a092888cf0 (patch) | |
tree | 9b8ae2b887a02a168273596f7e487b1d218d3611 | |
parent | bf76ce168cc82aae2158dac7f1c0360eb757936f (diff) | |
download | cpython-0063958c2ed210a0d70da2ab26f660a092888cf0.zip cpython-0063958c2ed210a0d70da2ab26f660a092888cf0.tar.gz cpython-0063958c2ed210a0d70da2ab26f660a092888cf0.tar.bz2 |
Minimum fixes to make freeze.py do something useful.
-rwxr-xr-x | Tools/freeze/freeze.py | 2 | ||||
-rw-r--r-- | Tools/freeze/makeconfig.py | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/Tools/freeze/freeze.py b/Tools/freeze/freeze.py index 2d8127a..a41267a 100755 --- a/Tools/freeze/freeze.py +++ b/Tools/freeze/freeze.py @@ -201,7 +201,7 @@ def main(): # modules that are imported by the Python runtime implicits = [] - for module in ('site', 'warnings',): + for module in ('site', 'warnings', 'encodings.utf_8', 'encodings.latin_1'): if module not in exclude: implicits.append(module) diff --git a/Tools/freeze/makeconfig.py b/Tools/freeze/makeconfig.py index 8eb0879..bed6f6a 100644 --- a/Tools/freeze/makeconfig.py +++ b/Tools/freeze/makeconfig.py @@ -3,14 +3,13 @@ import re # Write the config.c file -never = ['marshal', '__main__', 'builtins', 'sys', 'exceptions', '_warnings'] +never = ['marshal', 'imp', '_ast', '__main__', 'builtins', + 'sys', 'gc', '_warnings'] def makeconfig(infp, outfp, modules, with_ifdef=0): m1 = re.compile('-- ADDMODULE MARKER 1 --') m2 = re.compile('-- ADDMODULE MARKER 2 --') - while 1: - line = infp.readline() - if not line: break + for line in infp: outfp.write(line) if m1 and m1.search(line): m1 = None @@ -18,8 +17,8 @@ def makeconfig(infp, outfp, modules, with_ifdef=0): if mod in never: continue if with_ifdef: - outfp.write("#ifndef init%s\n"%mod) - outfp.write('extern void init%s(void);\n' % mod) + outfp.write("#ifndef PyInit_%s\n"%mod) + outfp.write('extern PyObject* PyInit_%s(void);\n' % mod) if with_ifdef: outfp.write("#endif\n") elif m2 and m2.search(line): @@ -27,7 +26,7 @@ def makeconfig(infp, outfp, modules, with_ifdef=0): for mod in modules: if mod in never: continue - outfp.write('\t{"%s", init%s},\n' % + outfp.write('\t{"%s", PyInit_%s},\n' % (mod, mod)) if m1: sys.stderr.write('MARKER 1 never found\n') |