Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r59192:21d4c1bcf011
Date: 2012-12-01 19:52 +0100
http://bitbucket.org/pypy/pypy/changeset/21d4c1bcf011/
Log: cpyext: add PyExceptionInstance_Check
diff --git a/pypy/module/cpyext/include/pyerrors.h
b/pypy/module/cpyext/include/pyerrors.h
--- a/pypy/module/cpyext/include/pyerrors.h
+++ b/pypy/module/cpyext/include/pyerrors.h
@@ -11,6 +11,9 @@
((PyType_Check((x)) && \
PyObject_IsSubclass((x), PyExc_BaseException)))
+#define PyExceptionInstance_Check(x) \
+ (PyObject_IsSubclass((x)->ob_type, PyExc_BaseException))
+
PyObject *PyErr_NewException(const char *name, PyObject *base, PyObject *dict);
PyObject *PyErr_NewExceptionWithDoc(const char *name, const char *doc,
PyObject *base, PyObject *dict);
PyObject *PyErr_Format(PyObject *exception, const char *format, ...);
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit