From 5ba0cbe39221ff8985ce5a4702a3b01a17ae3248 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 6 Aug 2005 18:31:24 +0000 Subject: * set_new() doesn't need to zero the structure a second time after tp_alloc has already done the job. * Use a macro form of PyErr_Occurred() inside the set_lookkey() function. --- Include/pyerrors.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Include/pyerrors.h') diff --git a/Include/pyerrors.h b/Include/pyerrors.h index f18e579002..94a52903de 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -15,6 +15,12 @@ PyAPI_FUNC(void) PyErr_Clear(void); PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **); PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *); +#ifdef Py_DEBUG +#define _PyErr_OCCURRED() PyErr_Occurred() +#else +#define _PyErr_OCCURRED() (_PyThreadState_Current->curexc_type) +#endif + /* Error testing and normalization */ PyAPI_FUNC(int) PyErr_GivenExceptionMatches(PyObject *, PyObject *); PyAPI_FUNC(int) PyErr_ExceptionMatches(PyObject *); -- cgit v1.2.1