1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-23 03:16:37 +02:00

tests: fix scripting API tests with Python 3.8

This commit is contained in:
Sébastien Helleu
2022-08-02 21:35:33 +02:00
parent a7364d055b
commit 23707a12ea
+7 -2
View File
@@ -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."""