You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
strings need quotes in ADD_VALUE instructions
This commit is contained in:
@@ -233,7 +233,10 @@ class NonterminalActions:
|
||||
assert len(keys) == len(flat_elems) - 1
|
||||
for i, elem in enumerate(flat_elems[:-1]):
|
||||
assert elem.kind == "ADD_VALUE"
|
||||
value = elem.pattr
|
||||
try:
|
||||
value = "%r" % elem.pattr
|
||||
except Exception:
|
||||
value = elem.pattr
|
||||
if elem.linestart is not None:
|
||||
if elem.linestart != self.line_number:
|
||||
next_indent = self.indent + INDENT_PER_LEVEL[:-1]
|
||||
@@ -255,7 +258,10 @@ class NonterminalActions:
|
||||
else:
|
||||
for elem in flat_elems:
|
||||
assert elem.kind == "ADD_VALUE"
|
||||
value = elem.pattr
|
||||
try:
|
||||
value = "%r" % elem.pattr
|
||||
except Exception:
|
||||
value = elem.pattr
|
||||
if elem.linestart is not None:
|
||||
if elem.linestart != self.line_number:
|
||||
next_indent = self.indent + INDENT_PER_LEVEL[:-1]
|
||||
|
Reference in New Issue
Block a user