Klaus Demo ~jonashaag/bjoern / b8bdf05
Provide a Py_TYPE macro that's missing in Python 2.5 (#34) Jonas Haag 9 years ago
1 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
55 #include <stddef.h>
66 #include <stdbool.h>
77 #include <string.h>
8
9 #ifndef Py_TYPE
10 /* Python 2.5 compatibility */
11 # define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
12 #endif
813
914 #define TYPE_ERROR_INNER(what, expected, ...) \
1015 PyErr_Format(PyExc_TypeError, what " must be " expected " " __VA_ARGS__)