summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2011-12-17 05:36:54 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2011-12-17 05:36:54 +0000
commitb596115d7362e52b5fdc7c94ae11a8ea65c71311 (patch)
tree78b04e8791a46fa98894e08a4f5d34b94d766c21 /dev-python/numpy/files
parentwhitespace (diff)
downloadhistorical-b596115d7362e52b5fdc7c94ae11a8ea65c71311.tar.gz
historical-b596115d7362e52b5fdc7c94ae11a8ea65c71311.tar.bz2
historical-b596115d7362e52b5fdc7c94ae11a8ea65c71311.zip
Added patch for python-3, thanks Johan Bergström, bug #393679
Package-Manager: portage-2.1.10.41/cvs/Linux x86_64
Diffstat (limited to 'dev-python/numpy/files')
-rw-r--r--dev-python/numpy/files/numpy-1.6.1-import_umath.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/dev-python/numpy/files/numpy-1.6.1-import_umath.patch b/dev-python/numpy/files/numpy-1.6.1-import_umath.patch
new file mode 100644
index 000000000000..aedaa2024206
--- /dev/null
+++ b/dev-python/numpy/files/numpy-1.6.1-import_umath.patch
@@ -0,0 +1,67 @@
+http://projects.scipy.org/numpy/ticket/1919
+https://github.com/numpy/numpy/commit/4dac50bf1faf2c8189c277ec8f11ead506c243b1
+https://github.com/numpy/numpy/commit/418f070fc67d1ea2b6eae3259e9dcf7a980bbaaf
+
+--- numpy/core/code_generators/generate_ufunc_api.py
++++ numpy/core/code_generators/generate_ufunc_api.py
+@@ -75,14 +75,53 @@
+ return 0;
+ }
+
+-#define import_umath() { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); return; }}
+-
+-#define import_umath1(ret) { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); return ret; }}
+-
+-#define import_umath2(msg, ret) { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, msg); return ret; }}
+-
+-#define import_ufunc() { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); }}
++#if PY_VERSION_HEX >= 0x03000000
++#define NUMPY_IMPORT_UMATH_RETVAL NULL
++#else
++#define NUMPY_IMPORT_UMATH_RETVAL
++#endif
+
++#define import_umath() \
++ do {\
++ UFUNC_NOFPE\
++ if (_import_umath() < 0) {\
++ PyErr_Print();\
++ PyErr_SetString(PyExc_ImportError,\
++ "numpy.core.umath failed to import");\
++ return NUMPY_IMPORT_UMATH_RETVAL;\
++ }\
++ } while(0)
++
++#define import_umath1(ret) \
++ do {\
++ UFUNC_NOFPE\
++ if (_import_umath() < 0) {\
++ PyErr_Print();\
++ PyErr_SetString(PyExc_ImportError,\
++ "numpy.core.umath failed to import");\
++ return ret;\
++ }\
++ } while(0)
++
++#define import_umath2(ret, msg) \
++ do {\
++ UFUNC_NOFPE\
++ if (_import_umath() < 0) {\
++ PyErr_Print();\
++ PyErr_SetString(PyExc_ImportError, msg);\
++ return ret;\
++ }\
++ } while(0)
++
++#define import_ufunc() \
++ do {\
++ UFUNC_NOFPE\
++ if (_import_umath() < 0) {\
++ PyErr_Print();\
++ PyErr_SetString(PyExc_ImportError,\
++ "numpy.core.umath failed to import");\
++ }\
++ } while(0)
+
+ #endif
+ """