You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Start PyPy 3.8 support
This commit is contained in:
9
Makefile
9
Makefile
@@ -11,7 +11,10 @@ RM ?= rm
|
|||||||
LINT = flake8
|
LINT = flake8
|
||||||
|
|
||||||
#EXTRA_DIST=ipython/ipy_trepan.py trepan
|
#EXTRA_DIST=ipython/ipy_trepan.py trepan
|
||||||
PHONY=all check clean distcheck pytest check-long dist distclean lint flake8 test rmChangeLog clean_pyc
|
PHONY=all check check-2.7 check-3.4 \
|
||||||
|
clean distcheck pytest check-long check-short \
|
||||||
|
dist distclean lint flake8 test rmChangeLog clean_pyc \
|
||||||
|
2.6 5.0 5.3 5.6 5.8 7.2 7.3 check-short
|
||||||
|
|
||||||
TEST_TYPES=check-long check-short check-2.7 check-3.4
|
TEST_TYPES=check-long check-short check-2.7 check-3.4
|
||||||
|
|
||||||
@@ -51,8 +54,8 @@ check-3.8:
|
|||||||
7.1 pypy-3.2 2.4:
|
7.1 pypy-3.2 2.4:
|
||||||
$(MAKE) -C test $@
|
$(MAKE) -C test $@
|
||||||
|
|
||||||
#:PyPy pypy3-2.4.0 Python 3.6.9:
|
#:PyPy versions
|
||||||
7.2:
|
7.2 7.3:
|
||||||
$(MAKE) -C test $@
|
$(MAKE) -C test $@
|
||||||
|
|
||||||
#: Run py.test tests
|
#: Run py.test tests
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
""" Trivial helper program to bytecompile and run an uncompile
|
""" Trivial helper program to bytecompile and run an uncompile
|
||||||
"""
|
"""
|
||||||
import os, sys, py_compile
|
import os, sys, py_compile
|
||||||
|
from xdis.version_info import version_tuple_to_str, PYTHON_VERSION_TRIPLE
|
||||||
|
|
||||||
assert (2 <= len(sys.argv) <= 4)
|
assert (2 <= len(sys.argv) <= 4)
|
||||||
version = sys.version[0:3]
|
version = sys.version[0:3]
|
||||||
@@ -23,14 +24,17 @@ except:
|
|||||||
for path in py_source:
|
for path in py_source:
|
||||||
short = os.path.basename(path)
|
short = os.path.basename(path)
|
||||||
if hasattr(sys, "pypy_version_info"):
|
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:
|
else:
|
||||||
cfile = "bytecode_%s%s/%s" % (version, suffix, short) + "c"
|
version = version_tuple_to_str(end=2)
|
||||||
print("byte-compiling %s to %s" % (path, cfile))
|
bytecode = "bytecode_%s%s/%s.pyc" % (version, suffix, short)
|
||||||
optimize = optimize
|
|
||||||
|
print("byte-compiling %s to %s" % (path, bytecode))
|
||||||
|
py_compile.compile(path, bytecode, optimize=optimize)
|
||||||
if vers > (3, 1):
|
if vers > (3, 1):
|
||||||
py_compile.compile(path, cfile, optimize=optimize)
|
py_compile.compile(path, bytecode, optimize=optimize)
|
||||||
else:
|
else:
|
||||||
py_compile.compile(path, cfile)
|
py_compile.compile(path, bytecode)
|
||||||
if vers >= (2, 6):
|
if PYTHON_VERSION_TRIPLE >= (2, 6):
|
||||||
os.system("../bin/uncompyle6 -a -T %s" % cfile)
|
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__")
|
pythonlib = os.path.join(pythonlib, "__pycache__")
|
||||||
test_options[key] = (os.path.join(lib_prefix, pythonlib), PYOC, pythonlib, vers)
|
test_options[key] = (os.path.join(lib_prefix, pythonlib), PYOC, pythonlib, vers)
|
||||||
|
|
||||||
vers = 3.7
|
for vers, vers_dot in ((37, 3.7), (38, 3.8)):
|
||||||
bytecode = "bytecode_pypy%s_run" % vers
|
bytecode = "bytecode_pypy%s_run" % vers
|
||||||
key = "bytecode-pypy37"
|
key = "bytecode-pypy%s" % vers
|
||||||
test_options[key] = (bytecode, PYC, bytecode, vers)
|
test_options[key] = (bytecode, PYC, bytecode, vers_dot)
|
||||||
|
key = "bytecode-pypy%s" % vers_dot
|
||||||
|
test_options[key] = (bytecode, PYC, bytecode, vers_dot)
|
||||||
|
|
||||||
|
|
||||||
# -----
|
# -----
|
||||||
|
@@ -580,7 +580,7 @@ def get_scanner(version, is_pypy=False, show_asm=None):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import inspect, uncompyle6
|
import inspect
|
||||||
|
|
||||||
co = inspect.currentframe().f_code
|
co = inspect.currentframe().f_code
|
||||||
# scanner = get_scanner('2.7.13', True)
|
# scanner = get_scanner('2.7.13', True)
|
||||||
|
Reference in New Issue
Block a user