From a4c73b9ae79ab41f24a0c3834cd6fec6dd10a653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 2 Aug 2022 20:55:59 +0200 Subject: [PATCH] tests: fix assignment in tcl script generator --- tests/scripts/python/unparse.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/scripts/python/unparse.py b/tests/scripts/python/unparse.py index 2a9c05b80..d387cd906 100755 --- a/tests/scripts/python/unparse.py +++ b/tests/scripts/python/unparse.py @@ -697,14 +697,15 @@ class UnparseTcl(UnparsePython): def _ast_assign(self, node): """Add an AST Assign in output.""" + exclude_types = (ast.Dict, ast.Str, ast.Subscript) self.add( self.fill, 'set ', node.targets[0], ' ', - '[' if not isinstance(node.value, ast.Str) else '', + '[' if not isinstance(node.value, exclude_types) else '', node.value, - ']' if not isinstance(node.value, ast.Str) else '', + ']' if not isinstance(node.value, exclude_types) else '', ) def _ast_attribute(self, node):