You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
strings need quotes in ADD_VALUE instructions
This commit is contained in:
@@ -31,7 +31,6 @@ from uncompyle6.semantics.helper import (
|
||||
find_globals_and_nonlocals,
|
||||
find_none,
|
||||
)
|
||||
from itertools import zip_longest
|
||||
|
||||
from uncompyle6.show import maybe_show_tree_param_default
|
||||
|
||||
@@ -249,7 +248,9 @@ def make_function36(self, node, is_lambda, nested=1, code_node=None):
|
||||
self.write(", ")
|
||||
ends_in_comma = True
|
||||
|
||||
ann_dict = kw_dict = default_tup = None
|
||||
# ann_dict = kw_dict = default_tup = None
|
||||
kw_dict = None
|
||||
|
||||
fn_bits = node[-1].attr
|
||||
# Skip over:
|
||||
# MAKE_FUNCTION,
|
||||
|
@@ -233,6 +233,9 @@ class NonterminalActions:
|
||||
assert len(keys) == len(flat_elems) - 1
|
||||
for i, elem in enumerate(flat_elems[:-1]):
|
||||
assert elem.kind == "ADD_VALUE"
|
||||
try:
|
||||
value = "%r" % elem.pattr
|
||||
except Exception:
|
||||
value = elem.pattr
|
||||
if elem.linestart is not None:
|
||||
if elem.linestart != self.line_number:
|
||||
@@ -255,6 +258,9 @@ class NonterminalActions:
|
||||
else:
|
||||
for elem in flat_elems:
|
||||
assert elem.kind == "ADD_VALUE"
|
||||
try:
|
||||
value = "%r" % elem.pattr
|
||||
except Exception:
|
||||
value = elem.pattr
|
||||
if elem.linestart is not None:
|
||||
if elem.linestart != self.line_number:
|
||||
|
Reference in New Issue
Block a user