You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
use totally xdis's opcodes
Needs xdis 1.1.0 or greater
This commit is contained in:
@@ -30,12 +30,6 @@ if PYTHON3:
|
||||
else:
|
||||
L65536 = long(65536) # NOQA
|
||||
|
||||
from uncompyle6.opcodes import (opcode_25, opcode_26)
|
||||
|
||||
from xdis.opcodes import (opcode_27,
|
||||
opcode_32, opcode_33, opcode_34, opcode_35)
|
||||
|
||||
|
||||
class Code(object):
|
||||
'''
|
||||
Class for representing code-objects.
|
||||
@@ -55,18 +49,25 @@ class Scanner(object):
|
||||
self.version = version
|
||||
# FIXME: DRY
|
||||
if version == 2.7:
|
||||
from xdis.opcodes import opcode_27
|
||||
self.opc = opcode_27
|
||||
elif version == 2.6:
|
||||
from xdis.opcodes import opcode_26
|
||||
self.opc = opcode_26
|
||||
elif version == 2.5:
|
||||
from xdis.opcodes import opcode_25
|
||||
self.opc = opcode_25
|
||||
elif version == 3.2:
|
||||
from xdis.opcodes import opcode_32
|
||||
self.opc = opcode_32
|
||||
elif version == 3.3:
|
||||
from xdis.opcodes import opcode_33
|
||||
self.opc = opcode_33
|
||||
elif version == 3.4:
|
||||
from xdis.opcodes import opcode_34
|
||||
self.opc = opcode_34
|
||||
elif version == 3.5:
|
||||
from xdis.opcodes import opcode_35
|
||||
self.opc = opcode_35
|
||||
else:
|
||||
raise TypeError("%s is not a Python version I know about" % version)
|
||||
|
Reference in New Issue
Block a user