From: Stefan Behnel Date: Mon, 4 May 2009 20:19:40 +0000 (+0200) Subject: re-allow 'pass' statement in cdef blocks X-Git-Tag: 0.11.2.rc1~10^2~36^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=14acb8346308267dff7457e2f8d5bfc3789358cb;p=cython.git re-allow 'pass' statement in cdef blocks --- diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index ad2d2f77..ac812f73 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -1498,6 +1498,9 @@ def p_statement(s, ctx, first_statement = 0): decorators = p_decorators(s) if s.sy not in ('def', 'cdef', 'cpdef'): s.error("Decorators can only be followed by functions ") + elif s.sy == 'pass' and cdef_flag: + # empty cdef block + return p_pass_statement(s, with_newline = 1) overridable = 0 if s.sy == 'cdef':