summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
committerGuido van Rossum <guido@python.org>2006-03-15 04:58:47 (GMT)
commit45aecf451a64fb1ebe5e74d0b00965ac8d99dff6 (patch)
treea7edcfb45ceafcffde68a3542aeba67089ea81cb /Include/pyerrors.h
parentf3175f6341ae207543a0d2d3be36c457349066e6 (diff)
downloadcpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.zip
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.gz
cpython-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.bz2
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done) - int/int -> float - all exceptions must derive from BaseException - absolute import - 'as' and 'with' are keywords
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 1fe2e45..0e7718c 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -28,25 +28,18 @@ PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
/* */
-#define PyExceptionClass_Check(x) \
- (PyClass_Check((x)) \
- || (PyType_Check((x)) && PyType_IsSubtype( \
- (PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException)))
+#define PyExceptionClass_Check(x) \
+ (PyType_Check((x)) && PyType_IsSubtype( \
+ (PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException))
-#define PyExceptionInstance_Check(x) \
- (PyInstance_Check((x)) || \
- (PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException)))
+#define PyExceptionInstance_Check(x) \
+ (PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException))
-#define PyExceptionClass_Name(x) \
- (PyClass_Check((x)) \
- ? PyString_AS_STRING(((PyClassObject*)(x))->cl_name) \
- : (char *)(((PyTypeObject*)(x))->tp_name))
+#define PyExceptionClass_Name(x) \
+ ((char *)(((PyTypeObject*)(x))->tp_name))
-#define PyExceptionInstance_Class(x) \
- ((PyInstance_Check((x)) \
- ? (PyObject*)((PyInstanceObject*)(x))->in_class \
- : (PyObject*)((x)->ob_type)))
+#define PyExceptionInstance_Class(x) ((PyObject*)((x)->ob_type))
/* Predefined exceptions */