Start handling Pyton 2.4 bytecodes

This commit is contained in:
rocky
2016-07-08 14:56:57 -04:00
parent 7fdb4d3e68
commit 62e60817f6
17 changed files with 125 additions and 21 deletions

View File

@@ -2,12 +2,12 @@
""" Trivial helper program to bytecompile and run an uncompile
"""
import os, sys, py_compile
assert len(sys.argv) == 2
path = sys.argv[1]
short = os.path.basename(path)
assert len(sys.argv) >= 2
version = sys.version[0:3]
cfile = "bytecode_%s/%s" % (version, short) + 'c'
print("byte-compiling %s to %s" % (path, cfile))
py_compile.compile(path, cfile)
if sys.version >= (2, 6, 0):
os.system("../bin/uncompyle6 -a -t %s" % cfile)
for path in sys.argv[1:]:
short = os.path.basename(path)
cfile = "bytecode_%s/%s" % (version, short) + 'c'
print("byte-compiling %s to %s" % (path, cfile))
py_compile.compile(path, cfile)
if sys.version >= (2, 6, 0):
os.system("../bin/uncompyle6 -a -t %s" % cfile)