diff options
author | Robert Bradshaw <robertwb@gmail.com> | 2014-02-22 01:55:48 -0800 |
---|---|---|
committer | Robert Bradshaw <robertwb@gmail.com> | 2014-02-22 01:55:48 -0800 |
commit | 9ae2d8d97439d9160954ab4a372e3f7b8ace4c91 (patch) | |
tree | 9d931ddbf73a5b6cce3e101cb20b5f8a6db32ca1 /Cython/Utility/ModuleSetupCode.c | |
parent | e2bba539d6b1df0216e8f998898a0c1926dd8d42 (diff) | |
download | cython-9ae2d8d97439d9160954ab4a372e3f7b8ace4c91.tar.gz |
More obsolete code removal.
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r-- | Cython/Utility/ModuleSetupCode.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c index 0c5e70072..cca3084c7 100644 --- a/Cython/Utility/ModuleSetupCode.c +++ b/Cython/Utility/ModuleSetupCode.c @@ -157,33 +157,12 @@ #define PyBoolObject PyLongObject #endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif +#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t +#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif +#define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) +#define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) +#define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) |