summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2017-10-07 08:13:22 +0200
committerStefan Behnel <stefan_ml@behnel.de>2017-10-07 08:13:22 +0200
commitc90f1d8470f5c2321375521cf2affb28fb0e7610 (patch)
tree547a26feead5d027ae4d548a8dbabf06a292b803
parentce1f4296efe3fb7f6c1e241e6aa72447ebb3414b (diff)
downloadcython-c90f1d8470f5c2321375521cf2affb28fb0e7610.tar.gz
Remove accidental use of "await" as a name as it becomes a keyword in Py3.7.
Closes #1916.
-rw-r--r--Cython/Compiler/ExprNodes.py24
-rw-r--r--Cython/Compiler/ParseTreeTransforms.py4
2 files changed, 14 insertions, 14 deletions
diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 666d0e91e..07060b309 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -2867,18 +2867,18 @@ class WithExitCallNode(ExprNode):
# The __exit__() call of a 'with' statement. Used in both the
# except and finally clauses.
- # with_stat WithStatNode the surrounding 'with' statement
- # args TupleNode or ResultStatNode the exception info tuple
- # await AwaitExprNode the await expression of an 'async with' statement
+ # with_stat WithStatNode the surrounding 'with' statement
+ # args TupleNode or ResultStatNode the exception info tuple
+ # await_expr AwaitExprNode the await expression of an 'async with' statement
- subexprs = ['args', 'await']
+ subexprs = ['args', 'await_expr']
test_if_run = True
- await = None
+ await_expr = None
def analyse_types(self, env):
self.args = self.args.analyse_types(env)
- if self.await:
- self.await = self.await.analyse_types(env)
+ if self.await_expr:
+ self.await_expr = self.await_expr.analyse_types(env)
self.type = PyrexTypes.c_bint_type
self.is_temp = True
return self
@@ -2905,12 +2905,12 @@ class WithExitCallNode(ExprNode):
code.putln(code.error_goto_if_null(result_var, self.pos))
code.put_gotref(result_var)
- if self.await:
+ if self.await_expr:
# FIXME: result_var temp currently leaks into the closure
- self.await.generate_evaluation_code(code, source_cname=result_var, decref_source=True)
- code.putln("%s = %s;" % (result_var, self.await.py_result()))
- self.await.generate_post_assignment_code(code)
- self.await.free_temps(code)
+ self.await_expr.generate_evaluation_code(code, source_cname=result_var, decref_source=True)
+ code.putln("%s = %s;" % (result_var, self.await_expr.py_result()))
+ self.await_expr.generate_post_assignment_code(code)
+ self.await_expr.free_temps(code)
if self.result_is_used:
self.allocate_temp_result(code)
diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index f74ac3beb..6bf2d8592 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -1292,7 +1292,7 @@ class WithTransform(CythonTransform, SkipDeclarations):
pos, with_stat=node,
test_if_run=False,
args=excinfo_target,
- await=ExprNodes.AwaitExprNode(pos, arg=None) if is_async else None)),
+ await_expr=ExprNodes.AwaitExprNode(pos, arg=None) if is_async else None)),
body=Nodes.ReraiseStatNode(pos),
),
],
@@ -1314,7 +1314,7 @@ class WithTransform(CythonTransform, SkipDeclarations):
test_if_run=True,
args=ExprNodes.TupleNode(
pos, args=[ExprNodes.NoneNode(pos) for _ in range(3)]),
- await=ExprNodes.AwaitExprNode(pos, arg=None) if is_async else None)),
+ await_expr=ExprNodes.AwaitExprNode(pos, arg=None) if is_async else None)),
handle_error_case=False,
)
return node