From 770817e69fd13bfe51ba3d2b0e5246455db21883 Mon Sep 17 00:00:00 2001 From: Yiming Wang Date: Fri, 21 Nov 2025 19:16:19 +0800 Subject: [PATCH] fix const list for python 2.7 --- uncompyle6/semantics/n_actions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uncompyle6/semantics/n_actions.py b/uncompyle6/semantics/n_actions.py index a15d34fc9..2d44c38a3 100644 --- a/uncompyle6/semantics/n_actions.py +++ b/uncompyle6/semantics/n_actions.py @@ -273,7 +273,9 @@ def n_const_list(self, node: SyntaxTree): elem = elem[0] if elem == "ADD_VALUE": - if elem.optype in ("local", "name"): + if self.version < (3, 0, 0): + value = "%s" % repr(elem.pattr) + elif elem.optype in ("local", "name"): value = elem.attr elif elem.optype == "const" and not isinstance(elem.attr, str): value = elem.attr