You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Loosen check to allow running from 2.4-3.10
We still only can *decompile* 2.4-3.8
This commit is contained in:
@@ -28,7 +28,14 @@ import sys
|
||||
from uncompyle6.scanners.tok import Token
|
||||
from xdis.version_info import IS_PYPY, PYTHON3, version_tuple_to_str
|
||||
import xdis
|
||||
from xdis import Bytecode, canonic_python_version, code2num, instruction_size, extended_arg_val, next_offset
|
||||
from xdis import (
|
||||
Bytecode,
|
||||
canonic_python_version,
|
||||
code2num,
|
||||
instruction_size,
|
||||
extended_arg_val,
|
||||
next_offset,
|
||||
)
|
||||
|
||||
# The byte code versions we support.
|
||||
# Note: these all have to be tuples of 2 ints
|
||||
@@ -111,7 +118,10 @@ class Scanner(object):
|
||||
exec("from xdis.opcodes import %s" % v_str)
|
||||
exec("self.opc = %s" % v_str)
|
||||
else:
|
||||
raise TypeError("%s is not a Python version I know about" % version_tuple_to_str(version))
|
||||
raise TypeError(
|
||||
"%s is not a Python version I know about"
|
||||
% version_tuple_to_str(version)
|
||||
)
|
||||
|
||||
self.opname = self.opc.opname
|
||||
|
||||
@@ -566,7 +576,10 @@ def get_scanner(version, is_pypy=False, show_asm=None):
|
||||
"scan.Scanner%s(show_asm=show_asm)" % v_str, locals(), globals()
|
||||
)
|
||||
else:
|
||||
raise RuntimeError("Unsupported Python version %s" % version)
|
||||
raise RuntimeError(
|
||||
"Unsupported Python version, %s, for decompilation"
|
||||
% version_tuple_to_str(version)
|
||||
)
|
||||
return scanner
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user