diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-08-02 21:35:33 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-08-02 21:35:33 +0200 |
commit | 23707a12ea33c2747726c9d1d5917f33cbb9d3ea (patch) | |
tree | 8b054f8961dbc52f5cb17f0f7960489e0c90a537 | |
parent | a7364d055b3b52eb8669b2f17db32e64635d50fc (diff) | |
download | weechat-23707a12ea33c2747726c9d1d5917f33cbb9d3ea.zip |
tests: fix scripting API tests with Python 3.8
-rwxr-xr-x | tests/scripts/python/unparse.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/scripts/python/unparse.py b/tests/scripts/python/unparse.py index d387cd906..9fc24ee4a 100755 --- a/tests/scripts/python/unparse.py +++ b/tests/scripts/python/unparse.py @@ -255,6 +255,11 @@ class UnparsePython(object): self.unindent, ) + def _ast_index(self, node): + """Add an AST Subscript in output.""" + # note: deprecated since Python 3.9 + self.add(node.value) + def _ast_import(self, node): """Add an AST Import in output.""" # ignore import @@ -272,7 +277,7 @@ class UnparsePython(object): def _ast_num(self, node): """Add an AST Num in output.""" # note: deprecated since Python 3.8, replaced by ast.Constant - self.add(repr(node.n)) + self._ast_constant(node) def _ast_pass(self, node): # pylint: disable=unused-argument """Add an AST Pass in output.""" @@ -287,7 +292,7 @@ class UnparsePython(object): def _ast_str(self, node): """Add an AST Str in output.""" # note: deprecated since Python 3.8, replaced by ast.Constant - self.add(repr(node.s)) + self._ast_constant(node) def _ast_subscript(self, node): """Add an AST Subscript in output.""" |