summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2014-02-22 17:07:59 -0800
committerRobert Bradshaw <robertwb@gmail.com>2014-02-22 17:07:59 -0800
commitc384f01244c37312c87867fddf06febe4a3e1c44 (patch)
treefc6e711ff2a7cab9e5db88835fafe5f45c47536d /Cython/Utility/ModuleSetupCode.c
parentbc4ae58efb1e9d94ac74cd678314a782bbb4c6c4 (diff)
downloadcython-c384f01244c37312c87867fddf06febe4a3e1c44.tar.gz
Restore some over-eager 3.1 removals.
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index cca3084c7..031c6aa0b 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -157,12 +157,14 @@
#define PyBoolObject PyLongObject
#endif
-#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
-#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
-
-#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_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
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))