summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley M. Froehle <brad.froehle@gmail.com>2013-02-24 21:31:28 -0800
committerBradley M. Froehle <brad.froehle@gmail.com>2013-02-24 21:31:28 -0800
commita226daa75816577ac9c734133e600e5eebd9aaa9 (patch)
tree6bc93ddaf28d40377d58314609c656ce1833163f
parent6de7a4be70c894e3d63ac952bd20a74c171e6413 (diff)
downloadnumpy-a226daa75816577ac9c734133e600e5eebd9aaa9.tar.gz
BUG: Choose a more unique PY_ARRAY_UNIQUE_SYMBOL in f2py.
In a few exceptional cases where symbols are shared between different Python modules the use of `PyArray_API` in f2py (fortranobject.h) conflicts with the regular use of the same symbol in the multiarray module. Generally the symptom of this conflicting use is a segfault when importing a f2py'ed module. This occurs because the module init code somehow overwrites the first element of `PyArray_API` with the location of `PyArray_API`, causing a crash when `PyArray_GetNDArrayCVersion` is called. Closes gh-2521.
-rw-r--r--numpy/f2py/src/fortranobject.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h
index 283021aa1..07e810ff9 100644
--- a/numpy/f2py/src/fortranobject.h
+++ b/numpy/f2py/src/fortranobject.h
@@ -9,7 +9,7 @@ extern "C" {
#ifdef FORTRANOBJECT_C
#define NO_IMPORT_ARRAY
#endif
-#define PY_ARRAY_UNIQUE_SYMBOL PyArray_API
+#define PY_ARRAY_UNIQUE_SYMBOL _npy_f2py_ARRAY_API
#include "numpy/arrayobject.h"
/*