summaryrefslogtreecommitdiff
path: root/numpy/f2py/src
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-12-01 16:27:48 +0000
committerEric Wieser <wieser.eric@gmail.com>2019-12-02 09:28:44 +0000
commit3c6bbd7b43bf584aeef780a9e42acf2ecce7b179 (patch)
treeef8cae52c02e714a58861bbfbb4783cb0d5696ca /numpy/f2py/src
parent6fa0ff8e56e7e09f0c1cdbce2da338be073947e9 (diff)
downloadnumpy-3c6bbd7b43bf584aeef780a9e42acf2ecce7b179.tar.gz
ENH: Chain exceptions when converting python objects to fortran
Note that since we now need `npy_3kcompat.h`, we can delete all duplicated lines in this file We preserve the original exception type for compatibility with old code here.
Diffstat (limited to 'numpy/f2py/src')
-rw-r--r--numpy/f2py/src/fortranobject.h25
1 files changed, 1 insertions, 24 deletions
diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h
index 5d0dcf676..21f1977eb 100644
--- a/numpy/f2py/src/fortranobject.h
+++ b/numpy/f2py/src/fortranobject.h
@@ -11,30 +11,7 @@ extern "C" {
#endif
#define PY_ARRAY_UNIQUE_SYMBOL _npy_f2py_ARRAY_API
#include "numpy/arrayobject.h"
-
-/*
- * Python 3 support macros
- */
-#if PY_VERSION_HEX >= 0x03000000
-#define PyString_Check PyBytes_Check
-#define PyString_GET_SIZE PyBytes_GET_SIZE
-#define PyString_AS_STRING PyBytes_AS_STRING
-#define PyString_FromString PyBytes_FromString
-#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize
-#define PyString_ConcatAndDel PyBytes_ConcatAndDel
-#define PyString_AsString PyBytes_AsString
-
-#define PyInt_Check PyLong_Check
-#define PyInt_FromLong PyLong_FromLong
-#define PyInt_AS_LONG PyLong_AsLong
-#define PyInt_AsLong PyLong_AsLong
-
-#define PyNumber_Int PyNumber_Long
-
-#else
-
-#define PyUString_FromStringAndSize PyString_FromStringAndSize
-#endif
+#include "numpy/npy_3kcompat.h"
#ifdef F2PY_REPORT_ATEXIT