You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Start PyPy 3.8 support
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
""" Trivial helper program to bytecompile and run an uncompile
|
||||
"""
|
||||
import os, sys, py_compile
|
||||
from xdis.version_info import version_tuple_to_str, PYTHON_VERSION_TRIPLE
|
||||
|
||||
assert (2 <= len(sys.argv) <= 4)
|
||||
version = sys.version[0:3]
|
||||
@@ -23,14 +24,17 @@ except:
|
||||
for path in py_source:
|
||||
short = os.path.basename(path)
|
||||
if hasattr(sys, "pypy_version_info"):
|
||||
cfile = "bytecode_pypy%s%s/%s" % (version, suffix, short) + "c"
|
||||
version = version_tuple_to_str(end=2, delimiter="")
|
||||
bytecode = "bytecode_pypy%s%s/%spy%s.pyc" % (version, suffix, short, version)
|
||||
else:
|
||||
cfile = "bytecode_%s%s/%s" % (version, suffix, short) + "c"
|
||||
print("byte-compiling %s to %s" % (path, cfile))
|
||||
optimize = optimize
|
||||
version = version_tuple_to_str(end=2)
|
||||
bytecode = "bytecode_%s%s/%s.pyc" % (version, suffix, short)
|
||||
|
||||
print("byte-compiling %s to %s" % (path, bytecode))
|
||||
py_compile.compile(path, bytecode, optimize=optimize)
|
||||
if vers > (3, 1):
|
||||
py_compile.compile(path, cfile, optimize=optimize)
|
||||
py_compile.compile(path, bytecode, optimize=optimize)
|
||||
else:
|
||||
py_compile.compile(path, cfile)
|
||||
if vers >= (2, 6):
|
||||
os.system("../bin/uncompyle6 -a -T %s" % cfile)
|
||||
py_compile.compile(path, bytecode)
|
||||
if PYTHON_VERSION_TRIPLE >= (2, 6):
|
||||
os.system("../bin/uncompyle6 -a -t %s" % bytecode)
|
||||
|
Binary file not shown.
BIN
test/bytecode_pypy38_run/01_callback.pypy38.pyc
Normal file
BIN
test/bytecode_pypy38_run/01_callback.pypy38.pyc
Normal file
Binary file not shown.
@@ -116,10 +116,12 @@ for vers in (
|
||||
pythonlib = os.path.join(pythonlib, "__pycache__")
|
||||
test_options[key] = (os.path.join(lib_prefix, pythonlib), PYOC, pythonlib, vers)
|
||||
|
||||
vers = 3.7
|
||||
bytecode = "bytecode_pypy%s_run" % vers
|
||||
key = "bytecode-pypy37"
|
||||
test_options[key] = (bytecode, PYC, bytecode, vers)
|
||||
for vers, vers_dot in ((37, 3.7), (38, 3.8)):
|
||||
bytecode = "bytecode_pypy%s_run" % vers
|
||||
key = "bytecode-pypy%s" % vers
|
||||
test_options[key] = (bytecode, PYC, bytecode, vers_dot)
|
||||
key = "bytecode-pypy%s" % vers_dot
|
||||
test_options[key] = (bytecode, PYC, bytecode, vers_dot)
|
||||
|
||||
|
||||
# -----
|
||||
|
Reference in New Issue
Block a user