From: Robert Bradshaw Date: Sat, 26 Apr 2008 15:45:09 +0000 (-0700) Subject: Allow predeclared __Pyx_CppExn2PyErr. X-Git-Tag: 0.9.6.14~21^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=911ca8a1141d7805d6d1e0097cf38eb94319815e;p=cython.git Allow predeclared __Pyx_CppExn2PyErr. --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 8fb24723..209b4d95 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -4102,9 +4102,8 @@ bad: cpp_exception_utility_code = [ """ -static int __Pyx_CppExn2PyErr(); /*proto*/ -""",""" -void __Pyx_CppExn2PyErr() { +#ifndef __Pyx_CppExn2PyErr +static void __Pyx_CppExn2PyErr() { try { if (PyErr_Occurred()) ; // let the latest Python exn pass through and ignore the current one @@ -4121,6 +4120,7 @@ void __Pyx_CppExn2PyErr() { PyErr_SetString(PyExc_RuntimeError, "Unknown exception"); } } -"""] +#endif +""",""] #------------------------------------------------------------------------------------