From 2b7924e30b901ea7a0b7f3ecf89fbe9160fc103f Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 7 Mar 2009 13:05:11 -0800 Subject: [PATCH] Enable @locals for methods (ctx is c_class_pxd, not class_pxd) --- Cython/Compiler/Parsing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 7b4dc986..2ec67e41 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -1491,7 +1491,8 @@ def p_statement(s, ctx, first_statement = 0): elif s.sy == 'IF': return p_IF_statement(s, ctx) elif s.sy == 'DECORATOR': - if ctx.level not in ('module', 'class', 'c_class', 'property', 'module_pxd', 'class_pxd'): + if ctx.level not in ('module', 'class', 'c_class', 'property', 'module_pxd', 'c_class_pxd'): + print ctx.level s.error('decorator not allowed here') s.level = ctx.level decorators = p_decorators(s) -- 2.26.2