Skip to content

Commit

Permalink
Remove Python 2 compatibility checks
Browse files Browse the repository at this point in the history
  • Loading branch information
naglis committed Dec 29, 2024
1 parent 96ffc38 commit 6a80454
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 69 deletions.
14 changes: 0 additions & 14 deletions aeneas/cdtw/cdtw_py.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,6 @@ static PyMethodDef cdtw_methods[] = {
}
};

// Python 2 and 3
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"cdtw", /* m_name */
Expand All @@ -454,32 +452,20 @@ static struct PyModuleDef moduledef = {
NULL, /* m_clear */
NULL, /* m_free */
};
#endif

static PyObject *moduleinit(void) {
PyObject *m;

#if PY_MAJOR_VERSION >= 3
m = PyModule_Create(&moduledef);
#else
m = Py_InitModule("cdtw", cdtw_methods);
#endif

return m;
}

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_cdtw(void) {
PyObject *ret = moduleinit();
import_array();
return ret;
}
#else
PyMODINIT_FUNC initcdtw(void) {
moduleinit();
import_array();
}
#endif



14 changes: 0 additions & 14 deletions aeneas/cew/cew_py.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ static PyMethodDef cew_methods[] = {
}
};

// Python 2 and 3
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"cew", /* m_name */
Expand All @@ -162,29 +160,17 @@ static struct PyModuleDef moduledef = {
NULL, /* m_clear */
NULL, /* m_free */
};
#endif

static PyObject *moduleinit(void) {
PyObject *m;

#if PY_MAJOR_VERSION >= 3
m = PyModule_Create(&moduledef);
#else
m = Py_InitModule("cew", cew_methods);
#endif

return m;
}

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_cew(void) {
return moduleinit();
}
#else
PyMODINIT_FUNC initcew(void) {
moduleinit();
}
#endif



13 changes: 0 additions & 13 deletions aeneas/cfw/cfw_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ static PyMethodDef cfw_methods[] = {
}
};

// Python 2 and 3
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"cfw", /* m_name */
Expand All @@ -162,29 +160,18 @@ static struct PyModuleDef moduledef = {
NULL, /* m_clear */
NULL, /* m_free */
};
#endif

static PyObject *moduleinit(void) {
PyObject *m;

#if PY_MAJOR_VERSION >= 3
m = PyModule_Create(&moduledef);
#else
m = Py_InitModule("cfw", cfw_methods);
#endif

return m;
}

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_cfw(void) {
return moduleinit();
}
#else
PyMODINIT_FUNC initcfw(void) {
moduleinit();
}
#endif



14 changes: 0 additions & 14 deletions aeneas/cmfcc/cmfcc_py.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ static PyMethodDef cmfcc_methods[] = {
}
};

// Python 2 and 3
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"cmfcc", /* m_name */
Expand All @@ -249,32 +247,20 @@ static struct PyModuleDef moduledef = {
NULL, /* m_clear */
NULL, /* m_free */
};
#endif

static PyObject *moduleinit(void) {
PyObject *m;

#if PY_MAJOR_VERSION >= 3
m = PyModule_Create(&moduledef);
#else
m = Py_InitModule("cmfcc", cmfcc_methods);
#endif

return m;
}

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_cmfcc(void) {
PyObject *ret = moduleinit();
import_array();
return ret;
}
#else
PyMODINIT_FUNC initcmfcc(void) {
moduleinit();
import_array();
}
#endif



14 changes: 0 additions & 14 deletions aeneas/cwave/cwave_py.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ static PyMethodDef cwave_methods[] = {
}
};

// Python 2 and 3
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT,
"cwave", /* m_name */
Expand All @@ -160,32 +158,20 @@ static struct PyModuleDef moduledef = {
NULL, /* m_clear */
NULL, /* m_free */
};
#endif

static PyObject *moduleinit(void) {
PyObject *m;

#if PY_MAJOR_VERSION >= 3
m = PyModule_Create(&moduledef);
#else
m = Py_InitModule("cwave", cwave_methods);
#endif

return m;
}

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_cwave(void) {
PyObject *ret = moduleinit();
import_array();
return ret;
}
#else
PyMODINIT_FUNC initcwave(void) {
moduleinit();
import_array();
}
#endif



0 comments on commit 6a80454

Please sign in to comment.