Read about our upcoming Code of Conduct on this issue

Commit 9da8f603 authored by Pierre Augier's avatar Pierre Augier
Browse files

Python 3.8 support (gast>=0.3.0, beniget>=0.2.0)

parent 0891a5751973
......@@ -84,7 +84,7 @@ def get_block_definitions(code, module, ancestors, duc, udc):
# no it's not a block definition
continue
name_block = call.args[0].s
name_block = call.args[0].value
rawcode, comments = gather_rawcode_comments(if_node, code)
......
......@@ -44,7 +44,7 @@ def _fill_ast_annotations_function(function_def, ast_annotations):
except AttributeError:
name = arg.id
dict_node.keys.append(ast.Str(s=name))
dict_node.keys.append(ast.Constant(value=name, kind=None))
dict_node.values.append(arg.annotation)
......@@ -57,7 +57,7 @@ def _fill_ast_annotations_class(class_def, ast_annotations):
if node.annotation is not None:
name = node.target.id
dict_node.keys.append(ast.Str(s=name))
dict_node.keys.append(ast.Constant(value=name, kind=None))
dict_node.values.append(node.annotation)
......@@ -67,7 +67,7 @@ def get_annotations(object_def, namespace):
# print_dump(object_def)
ast_annotations = ast.Assign(
targets=[ast.Name(id="annotations", ctx=ast.Store(), annotation=None)],
targets=[ast.Name("annotations", ast.Store(), None, None)],
value=ast.Dict(keys=[], values=[]),
)
......
......@@ -221,6 +221,7 @@ class CythonBackend(BackendAOT):
body=[],
decorator_list=[],
returns=None,
type_comment=None,
)
signatures_func = []
if signatures_as_lists_strings:
......@@ -242,7 +243,7 @@ class CythonBackend(BackendAOT):
# change function parameters
if fdef.args.defaults:
name_start = ast.Name(id="*", ctx=ast.Param(), annotation=None)
name_start = ast.Name("*", ast.Param(), None, None)
fdef.args.defaults = [name_start] * len(fdef.args.defaults)
for name in fdef.args.args:
name.annotation = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment