summaryrefslogtreecommitdiff
path: root/numpy/f2py/rules.py
diff options
context:
space:
mode:
authorSeth Troisi <sethtroisi@google.com>2020-01-03 13:44:22 -0800
committerSeth Troisi <sethtroisi@google.com>2020-01-03 13:44:22 -0800
commit24189be60ec4d823f4068be727b5d28f7eacc823 (patch)
tree721707dce400a3cee2eea8f98e3d579ea904c367 /numpy/f2py/rules.py
parente1aecb08f99321b72959cc50eb7b47454b613f52 (diff)
downloadnumpy-24189be60ec4d823f4068be727b5d28f7eacc823.tar.gz
Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
Diffstat (limited to 'numpy/f2py/rules.py')
-rwxr-xr-xnumpy/f2py/rules.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index a147f94b4..2d9d05260 100755
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -180,7 +180,6 @@ static PyMethodDef f2py_module_methods[] = {
\t{NULL,NULL}
};
-#if PY_VERSION_HEX >= 0x03000000
static struct PyModuleDef moduledef = {
\tPyModuleDef_HEAD_INIT,
\t"#modulename#",
@@ -192,16 +191,11 @@ static struct PyModuleDef moduledef = {
\tNULL,
\tNULL
};
-#endif
PyMODINIT_FUNC PyInit_#modulename#(void) {
\tint i;
\tPyObject *m,*d, *s, *tmp;
-#if PY_VERSION_HEX >= 0x03000000
\tm = #modulename#_module = PyModule_Create(&moduledef);
-#else
-\tm = #modulename#_module = Py_InitModule(\"#modulename#\", f2py_module_methods);
-#endif
\tPy_TYPE(&PyFortran_Type) = &PyType_Type;
\timport_array();
\tif (PyErr_Occurred())
@@ -210,11 +204,7 @@ PyMODINIT_FUNC PyInit_#modulename#(void) {
\ts = PyString_FromString(\"$R""" + """evision: $\");
\tPyDict_SetItemString(d, \"__version__\", s);
\tPy_DECREF(s);
-#if PY_VERSION_HEX >= 0x03000000
\ts = PyUnicode_FromString(
-#else
-\ts = PyString_FromString(
-#endif
\t\t\"This module '#modulename#' is auto-generated with f2py (version:#f2py_version#).\\nFunctions:\\n\"\n#docs#\".\");
\tPyDict_SetItemString(d, \"__doc__\", s);
\tPy_DECREF(s);
@@ -442,11 +432,7 @@ rout_rules = [
tmp = F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL);
PyObject_SetAttrString(o,"_cpointer", tmp);
Py_DECREF(tmp);
-#if PY_VERSION_HEX >= 0x03000000
s = PyUnicode_FromString("#name#");
-#else
- s = PyString_FromString("#name#");
-#endif
PyObject_SetAttrString(o,"__name__", s);
Py_DECREF(s);
}
@@ -484,11 +470,7 @@ rout_rules = [
tmp = F2PyCapsule_FromVoidPtr((void*)#F_FUNC#(#name_lower#,#NAME#),NULL);
PyObject_SetAttrString(o,"_cpointer", tmp);
Py_DECREF(tmp);
-#if PY_VERSION_HEX >= 0x03000000
s = PyUnicode_FromString("#name#");
-#else
- s = PyString_FromString("#name#");
-#endif
PyObject_SetAttrString(o,"__name__", s);
Py_DECREF(s);
}