summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-08-06 18:31:24 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-08-06 18:31:24 (GMT)
commit5ba0cbe39221ff8985ce5a4702a3b01a17ae3248 (patch)
tree1902f3101c306803111ccca197534fcab4bd7a71 /Include/pyerrors.h
parentfe889f3c628797e5d4eb5e8cf26a783ed504a251 (diff)
downloadcpython-5ba0cbe39221ff8985ce5a4702a3b01a17ae3248.zip
cpython-5ba0cbe39221ff8985ce5a4702a3b01a17ae3248.tar.gz
cpython-5ba0cbe39221ff8985ce5a4702a3b01a17ae3248.tar.bz2
* 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.
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index f18e579..94a5290 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 *);