Skip to content

Commit 5d7b042

Browse files
authored
Merge pull request #235 from IntelPython/remove-is-py3k
Remove IS_PY3K macro and dead Python 2 init branch
2 parents 485ab42 + 62d14cf commit 5d7b042

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
### Removed
1616
* Removed the `python-gil` constraint from the conda recipes, which pinned `mkl-service` to GIL-enabled Python 3.14 builds [gh-213](https://github.com/IntelPython/mkl-service/pull/213)
17+
* Removed the `IS_PY3K` macro and the dead Python 2 module-init branch from `_mklinitmodule.c`, since the project requires Python 3.10+ [gh-235](https://github.com/IntelPython/mkl-service/pull/235)
1718

1819
## [2.8.0] (07/23/2026)
1920

mkl/_mklinitmodule.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
#undef _GNU_SOURCE
1515
#endif
1616

17-
#include <Python.h>
18-
#if PY_MAJOR_VERSION >= 3
19-
#define IS_PY3K
20-
#endif
2117
#include "mkl.h"
18+
#include <Python.h>
2219

2320
static struct PyMethodDef methods[] = {{NULL, NULL, 0, NULL}};
2421

@@ -176,7 +173,6 @@ static MKL_SERVICE_INLINE void _set_mkl_interface(void)
176173
_preload_threading_layer();
177174
}
178175

179-
#if defined(IS_PY3K)
180176
static struct PyModuleDef moduledef = {PyModuleDef_HEAD_INIT,
181177
"mklinit",
182178
NULL,
@@ -186,10 +182,8 @@ static struct PyModuleDef moduledef = {PyModuleDef_HEAD_INIT,
186182
NULL,
187183
NULL,
188184
NULL};
189-
#endif
190185

191186
/* Initialization function for the module */
192-
#if defined(IS_PY3K)
193187
PyMODINIT_FUNC PyInit__mklinit(void)
194188
{
195189
PyObject *m;
@@ -208,10 +202,3 @@ PyMODINIT_FUNC PyInit__mklinit(void)
208202

209203
return m;
210204
}
211-
#else
212-
PyMODINIT_FUNC init_mklinit(void)
213-
{
214-
_set_mkl_interface();
215-
Py_InitModule("_mklinit", methods);
216-
}
217-
#endif

0 commit comments

Comments
 (0)