diff options
author | Seth Troisi <sethtroisi@google.com> | 2020-01-03 13:23:52 -0800 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2020-01-03 15:23:52 -0600 |
commit | e1aecb08f99321b72959cc50eb7b47454b613f52 (patch) | |
tree | 369d1ad3168c7a160072d39768217d680dac3e0a /numpy/linalg/umath_linalg.c.src | |
parent | f30b2564d3923b2c307a026e4a22d20bc19872f0 (diff) | |
download | numpy-e1aecb08f99321b72959cc50eb7b47454b613f52.tar.gz |
MAINT: Remove Python2 specific C module setup (gh-15231)
Dropping the support for python 2, the difference in module setup do not have to be accounted
for anymore. This removes the macros and ifdef's related to module setup code and python 2
support.
Diffstat (limited to 'numpy/linalg/umath_linalg.c.src')
-rw-r--r-- | numpy/linalg/umath_linalg.c.src | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/numpy/linalg/umath_linalg.c.src b/numpy/linalg/umath_linalg.c.src index e864c541b..00ff6b7a8 100644 --- a/numpy/linalg/umath_linalg.c.src +++ b/numpy/linalg/umath_linalg.c.src @@ -3626,7 +3626,6 @@ static PyMethodDef UMath_LinAlgMethods[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; -#if defined(NPY_PY3K) static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, UMATH_LINALG_MODULE_NAME, @@ -3638,29 +3637,17 @@ static struct PyModuleDef moduledef = { NULL, NULL }; -#endif -#if defined(NPY_PY3K) -#define RETVAL(x) x PyObject *PyInit__umath_linalg(void) -#else -#define RETVAL(x) -PyMODINIT_FUNC -init_umath_linalg(void) -#endif { PyObject *m; PyObject *d; PyObject *version; init_constants(); -#if defined(NPY_PY3K) m = PyModule_Create(&moduledef); -#else - m = Py_InitModule(UMATH_LINALG_MODULE_NAME, UMath_LinAlgMethods); -#endif if (m == NULL) { - return RETVAL(NULL); + return NULL; } import_array(); @@ -3678,8 +3665,8 @@ init_umath_linalg(void) if (PyErr_Occurred()) { PyErr_SetString(PyExc_RuntimeError, "cannot load _umath_linalg module."); - return RETVAL(NULL); + return NULL; } - return RETVAL(m); + return m; } |