From 14acb8346308267dff7457e2f8d5bfc3789358cb Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 4 May 2009 22:19:40 +0200 Subject: [PATCH] re-allow 'pass' statement in cdef blocks --- Cython/Compiler/Parsing.py | 3 +++ 1 file changed, 3 insertions(+) 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': -- 2.26.2