You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
COME_FROM for 3.x POP_EXCEPT, DRY with op_name() ...
Start adding COME_FROMs for POP_EXCEPT in preparation for getting tryelse blocks correct. Simpler opname access functions: - self.op_name(op) is self.opc.opname[op] - self.op_name_from_offset(offset) is self.opc.opname[self.code[offset]] verify.py: not all offsets are ints
This commit is contained in:
@@ -66,6 +66,12 @@ class Scanner(object):
|
||||
# FIXME: This weird Python2 behavior is not Python3
|
||||
self.resetTokenClass()
|
||||
|
||||
def opname_for_offset(self, offset):
|
||||
return self.opc.opname[self.code[offset]]
|
||||
|
||||
def op_name(self, op):
|
||||
return self.opc.opname[op]
|
||||
|
||||
def is_jump_forward(self, offset):
|
||||
"""
|
||||
Return True if the code at offset is some sort of jump forward.
|
||||
|
Reference in New Issue
Block a user