From dca6d896d6a0fdd9805a0f3105f0a4b8162c2123 Mon Sep 17 00:00:00 2001 From: Brad Schoening Date: Thu, 14 Aug 2025 15:27:02 -0400 Subject: [PATCH 1/2] Removed 2.7 Cpython defines --- cassandra/cmurmur3.c | 14 -------------- cassandra/io/libevwrapper.c | 14 -------------- 2 files changed, 28 deletions(-) diff --git a/cassandra/cmurmur3.c b/cassandra/cmurmur3.c index bce513217d..7fcc6db416 100644 --- a/cassandra/cmurmur3.c +++ b/cassandra/cmurmur3.c @@ -216,8 +216,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 +243,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 +257,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 } From 87fa2d1acb41d23de5e8059f5d14d3eb16174464 Mon Sep 17 00:00:00 2001 From: Brad Schoening Date: Fri, 15 Aug 2025 21:05:12 -0400 Subject: [PATCH 2/2] removed python 2.5 #if --- cassandra/cmurmur3.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cassandra/cmurmur3.c b/cassandra/cmurmur3.c index 7fcc6db416..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