diff -r 6f4e0c462daf Lib/test/test_coroutines.py --- a/Lib/test/test_coroutines.py Wed Jul 22 14:49:13 2015 +0300 +++ b/Lib/test/test_coroutines.py Thu Jul 23 01:05:36 2015 +0300 @@ -211,6 +211,10 @@ pass """, + """async def foo(a:await b): + pass + """, + """def baz(): async def foo(a=await b): pass diff -r 6f4e0c462daf Lib/test/test_grammar.py --- a/Lib/test/test_grammar.py Wed Jul 22 14:49:13 2015 +0300 +++ b/Lib/test/test_grammar.py Thu Jul 23 01:05:36 2015 +0300 @@ -534,7 +534,8 @@ # Not allowed at class scope check_syntax_error(self, "class foo:yield 1") check_syntax_error(self, "class foo:yield from ()") - + # Check annotation refleak on SyntaxError + check_syntax_error(self, "def g(a:(yield)): pass") def test_raise(self): # 'raise' test [',' test] diff -r 6f4e0c462daf Python/compile.c --- a/Python/compile.c Wed Jul 22 14:49:13 2015 +0300 +++ b/Python/compile.c Thu Jul 23 01:05:36 2015 +0300 @@ -1556,7 +1556,8 @@ { if (annotation) { PyObject *mangled; - VISIT(c, expr, annotation); + if (!compiler_visit_expr(c, annotation)) + return -1; mangled = _Py_Mangle(c->u->u_private, id); if (!mangled) return -1;