diff options
Diffstat (limited to 'tools/py3cc/slow/main.py')
| -rwxr-xr-x | tools/py3cc/slow/main.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/py3cc/slow/main.py b/tools/py3cc/slow/main.py new file mode 100755 index 00000000000..996edb2bdda --- /dev/null +++ b/tools/py3cc/slow/main.py @@ -0,0 +1,19 @@ +import marshal +import sys + + +def main(): + srcpathx, in_fname, out_fname = sys.argv[1:] + srcpath = srcpathx[:-1] + + with open(in_fname, 'r', encoding='utf-8') as in_file: + source = in_file.read() + + code = compile(source, srcpath, 'exec', dont_inherit=True) + + with open(out_fname, 'wb') as out_file: + marshal.dump(code, out_file) + + +if __name__ == '__main__': + main() |
