[pypy-commit] pypy default: fix commit a0105e0d00db, which was just wrong. In the upstream numpy, NUMPY_IMPORT_ARRAY_RETVAL is returned only in case of error, which never happens on pypy. As it was written, import_array() caused the immediate return of the *caller*

antocuni pypy.commits at gmail.com
Thu Jan 19 10:41:58 EST 2017


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r89673:cccff8a7d738
Date: 2017-01-19 15:41 +0000
http://bitbucket.org/pypy/pypy/changeset/cccff8a7d738/

Log:	fix commit a0105e0d00db, which was just wrong. In the upstream
	numpy, NUMPY_IMPORT_ARRAY_RETVAL is returned only in case of error,
	which never happens on pypy. As it was written, import_array()
	caused the immediate return of the *caller*

diff --git a/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h b/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h
--- a/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h
+++ b/pypy/module/cpyext/include/_numpypy/numpy/__multiarray_api.h
@@ -11,6 +11,7 @@
 #define NUMPY_IMPORT_ARRAY_RETVAL
 #endif
 
-#define import_array() {return NUMPY_IMPORT_ARRAY_RETVAL;}
+/* on pypy import_array never fails, so it's just an empty macro */
+#define import_array()
 
 


More information about the pypy-commit mailing list