Skip to content

Commit 770817e

Browse files
committed
fix const list for python 2.7
1 parent 9a20d02 commit 770817e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

uncompyle6/semantics/n_actions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ def n_const_list(self, node: SyntaxTree):
273273
elem = elem[0]
274274

275275
if elem == "ADD_VALUE":
276-
if elem.optype in ("local", "name"):
276+
if self.version < (3, 0, 0):
277+
value = "%s" % repr(elem.pattr)
278+
elif elem.optype in ("local", "name"):
277279
value = elem.attr
278280
elif elem.optype == "const" and not isinstance(elem.attr, str):
279281
value = elem.attr

0 commit comments

Comments
 (0)