summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baeuml <baeuml@gmail.com>2013-01-16 21:57:50 +0100
committerMartin Baeuml <baeuml@gmail.com>2013-01-16 21:57:50 +0100
commit18bcac097c289f0ee937563652f771fe89c174f2 (patch)
tree89618d5afaec2676b5d43550d707e0bc15798069
parent27690e33fa2202ecb1bca338ff38320de84b27ea (diff)
downloadnumpy-18bcac097c289f0ee937563652f771fe89c174f2.tar.gz
fix numpy.i for python 3
PyFile_Check and PyInstance_Check have been removed from the C API for python 3. This removes calls to those two functions from numpy.i for PY_MAJOR_VERSION >= 3 so that it builds with a python 3 Python.h.
-rw-r--r--doc/swig/numpy.i4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/swig/numpy.i b/doc/swig/numpy.i
index ea3f76405..4de4a2036 100644
--- a/doc/swig/numpy.i
+++ b/doc/swig/numpy.i
@@ -50,9 +50,11 @@
if (PyDict_Check( py_obj)) return "dict" ;
if (PyList_Check( py_obj)) return "list" ;
if (PyTuple_Check( py_obj)) return "tuple" ;
- if (PyFile_Check( py_obj)) return "file" ;
if (PyModule_Check( py_obj)) return "module" ;
+%#if PY_MAJOR_VERSION < 3
+ if (PyFile_Check( py_obj)) return "file" ;
if (PyInstance_Check(py_obj)) return "instance" ;
+%#endif
return "unkown type";
}