re-allow 'pass' statement in cdef blocks
authorStefan Behnel <scoder@users.berlios.de>
Mon, 4 May 2009 20:19:40 +0000 (22:19 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 4 May 2009 20:19:40 +0000 (22:19 +0200)
Cython/Compiler/Parsing.py

index ad2d2f77af7942f0defde1a3355d25e68d3add01..ac812f734ca88bfd77b9c183681b37442892aa80 100644 (file)
@@ -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':