Skip to content

Commit dd2343d

Browse files
authored
Removed 2.7 Cpython defines (#1252)
1 parent a5c6c5f commit dd2343d

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

cassandra/cmurmur3.c

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
#include <Python.h>
1515
#include <stdio.h>
1616

17-
#if PY_VERSION_HEX < 0x02050000
18-
typedef int Py_ssize_t;
19-
#define PY_SSIZE_T_MAX INT_MAX
20-
#define PY_SSIZE_T_MIN INT_MIN
21-
#endif
22-
2317
#ifdef PYPY_VERSION
2418
#define COMPILING_IN_PYPY 1
2519
#define COMPILING_IN_CPYTHON 0
@@ -216,8 +210,6 @@ static PyMethodDef cmurmur3_methods[] = {
216210
{NULL, NULL, 0, NULL}
217211
};
218212

219-
#if PY_MAJOR_VERSION >= 3
220-
221213
static int cmurmur3_traverse(PyObject *m, visitproc visit, void *arg) {
222214
Py_VISIT(GETSTATE(m)->error);
223215
return 0;
@@ -245,18 +237,8 @@ static struct PyModuleDef moduledef = {
245237
PyObject *
246238
PyInit_cmurmur3(void)
247239

248-
#else
249-
#define INITERROR return
250-
251-
void
252-
initcmurmur3(void)
253-
#endif
254240
{
255-
#if PY_MAJOR_VERSION >= 3
256241
PyObject *module = PyModule_Create(&moduledef);
257-
#else
258-
PyObject *module = Py_InitModule("cmurmur3", cmurmur3_methods);
259-
#endif
260242
struct module_state *st = NULL;
261243

262244
if (module == NULL)
@@ -269,7 +251,5 @@ initcmurmur3(void)
269251
INITERROR;
270252
}
271253

272-
#if PY_MAJOR_VERSION >= 3
273254
return module;
274-
#endif
275255
}

cassandra/io/libevwrapper.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,6 @@ static PyMethodDef module_methods[] = {
583583
PyDoc_STRVAR(module_doc,
584584
"libev wrapper methods");
585585

586-
#if PY_MAJOR_VERSION >= 3
587586
static struct PyModuleDef moduledef = {
588587
PyModuleDef_HEAD_INIT,
589588
"libevwrapper",
@@ -600,13 +599,6 @@ static struct PyModuleDef moduledef = {
600599

601600
PyObject *
602601
PyInit_libevwrapper(void)
603-
604-
# else
605-
# define INITERROR return
606-
607-
void
608-
initlibevwrapper(void)
609-
#endif
610602
{
611603
PyObject *module = NULL;
612604

@@ -629,11 +621,7 @@ initlibevwrapper(void)
629621
if (PyType_Ready(&libevwrapper_TimerType) < 0)
630622
INITERROR;
631623

632-
# if PY_MAJOR_VERSION >= 3
633624
module = PyModule_Create(&moduledef);
634-
# else
635-
module = Py_InitModule3("libevwrapper", module_methods, module_doc);
636-
# endif
637625

638626
if (module == NULL)
639627
INITERROR;
@@ -674,7 +662,5 @@ initlibevwrapper(void)
674662
}
675663
#endif
676664

677-
#if PY_MAJOR_VERSION >= 3
678665
return module;
679-
#endif
680666
}

0 commit comments

Comments
 (0)