diff Include/pyerrors.h @ 35316:ce0995e01d3c legacy-trunk

* 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.
author Raymond Hettinger <python@rcn.com>
date Sat, 06 Aug 2005 18:31:24 +0000
parents b2fe5f8fcfdd
children 7fdc639bc5b4
line wrap: on
line diff
--- a/Include/pyerrors.h	Sat Aug 06 05:43:39 2005 +0000
+++ b/Include/pyerrors.h	Sat Aug 06 18:31:24 2005 +0000
@@ -15,6 +15,12 @@
 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 *);