From b3d784ee15c601b5c61d4f2907adedd84c79fc90 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 28 Jul 2022 01:58:34 -0700 Subject: [PATCH] switch ast for assignment to tuple to use the python 3 classes --- src/openpower/decoder/pseudo/parser.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openpower/decoder/pseudo/parser.py b/src/openpower/decoder/pseudo/parser.py index 9b203d44..76882527 100644 --- a/src/openpower/decoder/pseudo/parser.py +++ b/src/openpower/decoder/pseudo/parser.py @@ -41,12 +41,12 @@ def Assign(autoassign, assignname, left, right, iea_mode): elif isinstance(left, ast.Tuple): # List of things - make sure they are Name nodes names = [] - for child in left.getChildren(): + for child in left.elts: if not isinstance(child, ast.Name): raise SyntaxError("that assignment not supported") - names.append(child.name) - ass_list = [ast.AssName(name, 'OP_ASSIGN') for name in names] - return ast.Assign([ast.AssTuple(ass_list)], right) + names.append(child.id) + ass_list = [ast.Name(name, ast.Store()) for name in names] + return ast.Assign([ast.Tuple(ass_list)], right) elif isinstance(left, ast.Subscript): ls = left.slice # XXX changing meaning of "undefined" to a function -- 2.30.2