Skip to content

Commit cf0bfb7

Browse files
committed
chore: update calls to ast.Module
It is now needed to pass a second argument for the type_ignores argument https://bugs.python.org/issue35894
1 parent 6e45c9f commit cf0bfb7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pythonwhat/utils_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
def wrap_in_module(node):
7-
new_node = ast.Module(node)
7+
new_node = ast.Module(node, [])
88
if isinstance(node, list):
99
if len(node) > 0:
1010
new_node.first_token = node[0].first_token

pythonwhat/utils_env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def assign_from_ast(node, expr):
1010
"""
1111
if isinstance(expr, str):
1212
expr = ast.Name(id=expr, ctx=ast.Load())
13-
mod = ast.Module([ast.Assign(targets=[node], value=expr)])
13+
mod = ast.Module([ast.Assign(targets=[node], value=expr)], [])
1414
ast.fix_missing_locations(mod)
1515
return compile(mod, "<assignment_script>", "exec")
1616

0 commit comments

Comments
 (0)