[pypy-svn] r78847 - pypy/branch/fast-forward/pypy/module/cpyext/include

afa at codespeak.net afa at codespeak.net
Sun Nov 7 23:21:08 CET 2010


Author: afa
Date: Sun Nov  7 23:21:06 2010
New Revision: 78847

Modified:
   pypy/branch/fast-forward/pypy/module/cpyext/include/pyerrors.h
Log:
Add PyExceptionClass_Check


Modified: pypy/branch/fast-forward/pypy/module/cpyext/include/pyerrors.h
==============================================================================
--- pypy/branch/fast-forward/pypy/module/cpyext/include/pyerrors.h	(original)
+++ pypy/branch/fast-forward/pypy/module/cpyext/include/pyerrors.h	Sun Nov  7 23:21:06 2010
@@ -7,6 +7,10 @@
 extern "C" {
 #endif
 
+#define PyExceptionClass_Check(x)                                       \
+    (PyClass_Check((x)) || (PyType_Check((x)) &&                        \
+      PyObject_IsSubclass((x), PyExc_BaseException)))
+
 PyObject *PyErr_NewException(char *name, PyObject *base, PyObject *dict);
 PyObject *PyErr_Format(PyObject *exception, const char *format, ...);
 



More information about the Pypy-commit mailing list