You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 08:49:51 +08:00
Correct SET_LINENO handling in Python 2.2
Add more 2.2 tests
This commit is contained in:
@@ -13,7 +13,6 @@ class Python22Parser(Python23Parser):
|
||||
|
||||
def p_misc22(self, args):
|
||||
'''
|
||||
stmt ::= SET_LINENO
|
||||
_for ::= LOAD_CONST FOR_LOOP
|
||||
'''
|
||||
|
||||
|
@@ -8,6 +8,7 @@ information for later use in deparsing.
|
||||
"""
|
||||
|
||||
import uncompyle6.scanners.scanner23 as scan
|
||||
# from uncompyle6.scanners.scanner26 import disassemble as disassemble26
|
||||
|
||||
# bytecode verification, verify(), uses JUMP_OPs from here
|
||||
from xdis.opcodes import opcode_22
|
||||
@@ -24,4 +25,11 @@ class Scanner22(scan.Scanner23):
|
||||
self.opname = opcode_22.opname
|
||||
self.version = 2.2
|
||||
self.genexpr_name = '<generator expression>';
|
||||
self.parent_injest = self.disassemble
|
||||
self.disassemble = self.disassemble22
|
||||
return
|
||||
|
||||
def disassemble22(self, co, classname=None, code_objects={}, show_asm=None):
|
||||
tokens, customize = self.parent_injest(co, classname, code_objects, show_asm)
|
||||
tokens = [t for t in tokens if t.type != 'SET_LINENO']
|
||||
return tokens, customize
|
||||
|
Reference in New Issue
Block a user