diff options
author | Seth Troisi <sethtroisi@google.com> | 2020-01-03 13:44:22 -0800 |
---|---|---|
committer | Seth Troisi <sethtroisi@google.com> | 2020-01-03 13:44:22 -0800 |
commit | 24189be60ec4d823f4068be727b5d28f7eacc823 (patch) | |
tree | 721707dce400a3cee2eea8f98e3d579ea904c367 /tools | |
parent | e1aecb08f99321b72959cc50eb7b47454b613f52 (diff) | |
download | numpy-24189be60ec4d823f4068be727b5d28f7eacc823.tar.gz |
Cleaning up PY_MAJOR_VERSION/PY_VERSION_HEX
Diffstat (limited to 'tools')
-rw-r--r-- | tools/swig/numpy.i | 7 | ||||
-rw-r--r-- | tools/swig/pyfragments.swg | 15 |
2 files changed, 1 insertions, 21 deletions
diff --git a/tools/swig/numpy.i b/tools/swig/numpy.i index 36bb55c98..8416e82f3 100644 --- a/tools/swig/numpy.i +++ b/tools/swig/numpy.i @@ -120,11 +120,6 @@ if (PyDict_Check( py_obj)) return "dict" ; if (PyList_Check( py_obj)) return "list" ; if (PyTuple_Check( py_obj)) return "tuple" ; -%#if PY_MAJOR_VERSION < 3 - if (PyFile_Check( py_obj)) return "file" ; - if (PyModule_Check( py_obj)) return "module" ; - if (PyInstance_Check(py_obj)) return "instance" ; -%#endif return "unknown type"; } @@ -545,7 +540,7 @@ const npy_intp *dims = array_dimensions(ary); for (i=0; i < nd; ++i) n_non_one += (dims[i] != 1) ? 1 : 0; - if (n_non_one > 1) + if (n_non_one > 1) array_clearflags(ary,NPY_ARRAY_CARRAY); array_enableflags(ary,NPY_ARRAY_FARRAY); /* Recompute the strides */ diff --git a/tools/swig/pyfragments.swg b/tools/swig/pyfragments.swg index 97ca8cf97..ce2452f80 100644 --- a/tools/swig/pyfragments.swg +++ b/tools/swig/pyfragments.swg @@ -75,21 +75,6 @@ SWIGINTERN int SWIG_AsVal_dec(unsigned long)(PyObject *obj, unsigned long *val) { - %#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(obj)) - { - long v = PyInt_AsLong(obj); - if (v >= 0) - { - if (val) *val = v; - return SWIG_OK; - } - else - { - return SWIG_OverflowError; - } - } else - %#endif if (PyLong_Check(obj)) { unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) { |