diff --git a/cassandra/cmurmur3.c b/cassandra/cmurmur3.c index bce513217d..4affdad46c 100644 --- a/cassandra/cmurmur3.c +++ b/cassandra/cmurmur3.c @@ -14,12 +14,6 @@ #include #include -#if PY_VERSION_HEX < 0x02050000 -typedef int Py_ssize_t; -#define PY_SSIZE_T_MAX INT_MAX -#define PY_SSIZE_T_MIN INT_MIN -#endif - #ifdef PYPY_VERSION #define COMPILING_IN_PYPY 1 #define COMPILING_IN_CPYTHON 0 @@ -216,8 +210,6 @@ static PyMethodDef cmurmur3_methods[] = { {NULL, NULL, 0, NULL} }; -#if PY_MAJOR_VERSION >= 3 - static int cmurmur3_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(GETSTATE(m)->error); return 0; @@ -245,18 +237,8 @@ static struct PyModuleDef moduledef = { PyObject * PyInit_cmurmur3(void) -#else -#define INITERROR return - -void -initcmurmur3(void) -#endif { -#if PY_MAJOR_VERSION >= 3 PyObject *module = PyModule_Create(&moduledef); -#else - PyObject *module = Py_InitModule("cmurmur3", cmurmur3_methods); -#endif struct module_state *st = NULL; if (module == NULL) @@ -269,7 +251,5 @@ initcmurmur3(void) INITERROR; } -#if PY_MAJOR_VERSION >= 3 return module; -#endif } diff --git a/cassandra/io/libevwrapper.c b/cassandra/io/libevwrapper.c index 99e1df30f7..4a54cee513 100644 --- a/cassandra/io/libevwrapper.c +++ b/cassandra/io/libevwrapper.c @@ -583,7 +583,6 @@ static PyMethodDef module_methods[] = { PyDoc_STRVAR(module_doc, "libev wrapper methods"); -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, "libevwrapper", @@ -600,13 +599,6 @@ static struct PyModuleDef moduledef = { PyObject * PyInit_libevwrapper(void) - -# else -# define INITERROR return - -void -initlibevwrapper(void) -#endif { PyObject *module = NULL; @@ -629,11 +621,7 @@ initlibevwrapper(void) if (PyType_Ready(&libevwrapper_TimerType) < 0) INITERROR; -# if PY_MAJOR_VERSION >= 3 module = PyModule_Create(&moduledef); -# else - module = Py_InitModule3("libevwrapper", module_methods, module_doc); -# endif if (module == NULL) INITERROR; @@ -669,7 +657,5 @@ initlibevwrapper(void) PyEval_InitThreads(); } -#if PY_MAJOR_VERSION >= 3 return module; -#endif }