summaryrefslogtreecommitdiff
path: root/numpy/f2py/rules.py
diff options
context:
space:
mode:
authorSeth Troisi <sethtroisi@google.com>2020-01-03 13:23:52 -0800
committerSebastian Berg <sebastian@sipsolutions.net>2020-01-03 15:23:52 -0600
commite1aecb08f99321b72959cc50eb7b47454b613f52 (patch)
tree369d1ad3168c7a160072d39768217d680dac3e0a /numpy/f2py/rules.py
parentf30b2564d3923b2c307a026e4a22d20bc19872f0 (diff)
downloadnumpy-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/f2py/rules.py')
-rwxr-xr-xnumpy/f2py/rules.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index 28eb9da30..a147f94b4 100755
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -194,13 +194,7 @@ static struct PyModuleDef moduledef = {
};
#endif
-#if PY_VERSION_HEX >= 0x03000000
-#define RETVAL m
PyMODINIT_FUNC PyInit_#modulename#(void) {
-#else
-#define RETVAL
-PyMODINIT_FUNC init#modulename#(void) {
-#endif
\tint i;
\tPyObject *m,*d, *s, *tmp;
#if PY_VERSION_HEX >= 0x03000000
@@ -211,7 +205,7 @@ PyMODINIT_FUNC init#modulename#(void) {
\tPy_TYPE(&PyFortran_Type) = &PyType_Type;
\timport_array();
\tif (PyErr_Occurred())
-\t\t{PyErr_SetString(PyExc_ImportError, \"can't initialize module #modulename# (failed to import numpy)\"); return RETVAL;}
+\t\t{PyErr_SetString(PyExc_ImportError, \"can't initialize module #modulename# (failed to import numpy)\"); return m;}
\td = PyModule_GetDict(m);
\ts = PyString_FromString(\"$R""" + """evision: $\");
\tPyDict_SetItemString(d, \"__version__\", s);
@@ -245,7 +239,7 @@ PyMODINIT_FUNC init#modulename#(void) {
\tif (! PyErr_Occurred())
\t\ton_exit(f2py_report_on_exit,(void*)\"#modulename#\");
#endif
-\treturn RETVAL;
+\treturn m;
}
#ifdef __cplusplus
}