From 3b1b45de7bc432e080e02ef39a63f8c239d65879 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 15 May 2020 15:22:55 +0200 Subject: Allow decorators on nested async-def functions. Closes https://github.com/cython/cython/issues/1462 --- Cython/Compiler/Parsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Cython') diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 56884f0a2..fd19d6c8e 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -2237,7 +2237,7 @@ def p_statement(s, ctx, first_statement = 0): s.error('decorator not allowed here') s.level = ctx.level decorators = p_decorators(s) - if not ctx.allow_struct_enum_decorator and s.sy not in ('def', 'cdef', 'cpdef', 'class'): + if not ctx.allow_struct_enum_decorator and s.sy not in ('def', 'cdef', 'cpdef', 'class', 'async'): if s.sy == 'IDENT' and s.systring == 'async': pass # handled below else: -- cgit v1.2.1