You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
A more correct offset2inst_index update.
This commit is contained in:
@@ -260,7 +260,8 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
self.ast_errors = []
|
||||
# FIXME: have p.insts update in a better way
|
||||
# modularity is broken here
|
||||
self.p.insts = scanner.insts
|
||||
self.insts = scanner.insts
|
||||
self.offset2inst_index = scanner.offset2inst_index
|
||||
|
||||
# This is in Python 2.6 on. It changes the way
|
||||
# strings get interpreted. See n_LOAD_CONST
|
||||
@@ -2407,9 +2408,11 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
# modularity is broken here
|
||||
p_insts = self.p.insts
|
||||
self.p.insts = self.scanner.insts
|
||||
self.p.offset2inst_index = self.scanner.offset2inst_index
|
||||
ast = python_parser.parse(self.p, tokens, customize)
|
||||
self.customize(customize)
|
||||
self.p.insts = p_insts
|
||||
|
||||
except (python_parser.ParserError, AssertionError) as e:
|
||||
raise ParserError(e, tokens)
|
||||
transform_ast = self.treeTransform.transform(ast)
|
||||
@@ -2442,8 +2445,8 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
# modularity is broken here
|
||||
p_insts = self.p.insts
|
||||
self.p.insts = self.scanner.insts
|
||||
self.p.opc = self.scanner.opc
|
||||
self.p.offset2inst_index = self.scanner.offset2inst_index
|
||||
self.p.opc = self.scanner.opc
|
||||
ast = python_parser.parse(self.p, tokens, customize)
|
||||
self.p.insts = p_insts
|
||||
except (python_parser.ParserError, AssertionError) as e:
|
||||
|
Reference in New Issue
Block a user