Part of the decompye3 loop "continue" fixes

This commit is contained in:
rocky
2021-12-17 16:08:29 -05:00
parent 16c900ff1d
commit da2314f5ae
4 changed files with 75 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python
""" Trivial helper program to byte compile and run an uncompyle6 on the bytecode file.
""" Trivial helper program to byte compile and uncompile the bytecode file.
"""
import os, sys, py_compile
from xdis.version_info import version_tuple_to_str, PYTHON_VERSION_TRIPLE
@@ -8,6 +8,9 @@ if len(sys.argv) < 2:
print("Usage: add-test.py [--run] *python-source*... [optimize-level]")
sys.exit(1)
assert 2 <= len(sys.argv) <= 4
version = sys.version[0:3]
vers = sys.version_info[:2]
if sys.argv[1] in ("--run", "-r"):
suffix = "_run"
assert sys.argv >= 3
@@ -28,6 +31,8 @@ except:
for path in py_source:
short = os.path.basename(path)
if short.endswith(".py"):
short = short[: -len(".py")]
if hasattr(sys, "pypy_version_info"):
version = version_tuple_to_str(end=2, delimiter="")
bytecode = "bytecode_pypy%s%s/%spy%s.pyc" % (version, suffix, short, version)