1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-19 09:34:47 +02:00

tests: fix assignment in tcl script generator

This commit is contained in:
Sébastien Helleu
2022-08-02 20:55:59 +02:00
parent 3bc0453cae
commit a4c73b9ae7
+3 -2
View File
@@ -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):