From: Dag Sverre Seljebotn Date: Thu, 27 Nov 2008 16:54:26 +0000 (+0100) Subject: Fix broken error reporting for functions in pxds X-Git-Tag: 0.11-beta~193^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=55ac39ee5987a681b07a5b9ade320f221f37be61;p=cython.git Fix broken error reporting for functions in pxds --- diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 94689d6c..32669ff1 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -239,7 +239,6 @@ class PxdPostParse(CythonTransform): ok = True for stat in node.body.stats: if not isinstance(stat, CVarDefNode): - self.context.error("C function definition not allowed here") ok = False break node = CVarDefNode(node.pos, diff --git a/tests/errors/e_func_in_pxd.pyx b/tests/errors/e_func_in_pxd.pyx new file mode 100644 index 00000000..beef5a0e --- /dev/null +++ b/tests/errors/e_func_in_pxd.pyx @@ -0,0 +1,5 @@ +cimport e_func_in_pxd_support + +_ERRORS = u""" +1:5: function definition not allowed here +""" diff --git a/tests/errors/e_func_in_pxd_support.pxd b/tests/errors/e_func_in_pxd_support.pxd new file mode 100644 index 00000000..001e0701 --- /dev/null +++ b/tests/errors/e_func_in_pxd_support.pxd @@ -0,0 +1,2 @@ +cdef foo(): + return 1