You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Part of the decompye3 loop "continue" fixes
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user