summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/scripts/python/unparse.py5
1 files 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):