switch ast for assignment to tuple to use the python 3 classes
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 28 Jul 2022 08:58:34 +0000 (01:58 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 28 Jul 2022 08:58:34 +0000 (01:58 -0700)
src/openpower/decoder/pseudo/parser.py

index 9b203d44a1fc93adb2d86aa12ffbac237b8318bc..768825273f3ad3ded2266b308c899af6cee99f09 100644 (file)
@@ -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