Skip to content

Removed 2.7 Cpython defines #1252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions cassandra/cmurmur3.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
#include <Python.h>
#include <stdio.h>

#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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -269,7 +251,5 @@ initcmurmur3(void)
INITERROR;
}

#if PY_MAJOR_VERSION >= 3
return module;
#endif
}
14 changes: 0 additions & 14 deletions cassandra/io/libevwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -600,13 +599,6 @@ static struct PyModuleDef moduledef = {

PyObject *
PyInit_libevwrapper(void)

# else
# define INITERROR return

void
initlibevwrapper(void)
#endif
{
PyObject *module = NULL;

Expand All @@ -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;
Expand Down Expand Up @@ -669,7 +657,5 @@ initlibevwrapper(void)
PyEval_InitThreads();
}

#if PY_MAJOR_VERSION >= 3
return module;
#endif
}