Commit 25d042da authored by Stefan Behnel's avatar Stefan Behnel

Avoid an additional utility code section for 2-exception matching by relying...

Avoid an additional utility code section for 2-exception matching by relying on existing special-cased macros.
parent 9e04e1ee
...@@ -7724,7 +7724,7 @@ class ExceptClauseNode(Node): ...@@ -7724,7 +7724,7 @@ class ExceptClauseNode(Node):
) )
elif len(patterns) == 2: elif len(patterns) == 2:
code.globalstate.use_utility_code( code.globalstate.use_utility_code(
UtilityCode.load_cached("PyErrExceptionMatches2", "Exceptions.c")) UtilityCode.load_cached("FastTypeChecks", "ModuleSetupCode.c"))
exc_tests.append("__Pyx_PyErr_ExceptionMatches2(%s, %s)" % ( exc_tests.append("__Pyx_PyErr_ExceptionMatches2(%s, %s)" % (
patterns[0], patterns[1], patterns[0], patterns[1],
)) ))
......
...@@ -20,17 +20,6 @@ ...@@ -20,17 +20,6 @@
#endif #endif
/////////////// PyErrExceptionMatches2.proto ///////////////
//@substitute: naming
//@requires: ModuleSetupCode.c::FastTypeChecks
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_ExceptionMatchesInState2($local_tstate_cname, err1, err2)
#define __Pyx_PyErr_ExceptionMatchesInState2(tstate, err1, err2) __Pyx_PyErr_GivenExceptionMatches2((tstate)->curexc_type, err1, err2)
#else
#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(PyErr_Occurred(), err1, err2)
#endif
/////////////// PyErrExceptionMatches.proto /////////////// /////////////// PyErrExceptionMatches.proto ///////////////
//@substitute: naming //@substitute: naming
......
...@@ -936,6 +936,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj ...@@ -936,6 +936,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif #endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_Occurred(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment