|
Line
Link Here
|
| 0 |
-- numpy/core/code_generators/generate_ufunc_api.py |
0 |
++ numpy/core/code_generators/generate_ufunc_api.py |
|
Lines 75-88
Link Here
|
| 75 |
return 0; |
75 |
return 0; |
| 76 |
} |
76 |
} |
| 77 |
|
77 |
|
| 78 |
#define import_umath() { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); return; }} |
78 |
#if PY_VERSION_HEX >= 0x03000000 |
| 79 |
|
79 |
#define NUMPY_IMPORT_UMATH_RETVAL NULL |
| 80 |
#define import_umath1(ret) { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); return ret; }} |
80 |
#else |
| 81 |
|
81 |
#define NUMPY_IMPORT_UMATH_RETVAL |
| 82 |
#define import_umath2(msg, ret) { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, msg); return ret; }} |
82 |
#endif |
| 83 |
|
|
|
| 84 |
#define import_ufunc() { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); }} |
| 85 |
|
83 |
|
|
|
84 |
#define import_umath() \ |
| 85 |
do {\ |
| 86 |
UFUNC_NOFPE\ |
| 87 |
if (_import_umath() < 0) {\ |
| 88 |
PyErr_Print();\ |
| 89 |
PyErr_SetString(PyExc_ImportError,\ |
| 90 |
"numpy.core.umath failed to import");\ |
| 91 |
return NUMPY_IMPORT_UMATH_RETVAL;\ |
| 92 |
}\ |
| 93 |
} while(0) |
| 94 |
|
| 95 |
#define import_umath1(ret) \ |
| 96 |
do {\ |
| 97 |
UFUNC_NOFPE\ |
| 98 |
if (_import_umath() < 0) {\ |
| 99 |
PyErr_Print();\ |
| 100 |
PyErr_SetString(PyExc_ImportError,\ |
| 101 |
"numpy.core.umath failed to import");\ |
| 102 |
return ret;\ |
| 103 |
}\ |
| 104 |
} while(0) |
| 105 |
|
| 106 |
#define import_umath2(ret, msg) \ |
| 107 |
do {\ |
| 108 |
UFUNC_NOFPE\ |
| 109 |
if (_import_umath() < 0) {\ |
| 110 |
PyErr_Print();\ |
| 111 |
PyErr_SetString(PyExc_ImportError, msg);\ |
| 112 |
return ret;\ |
| 113 |
}\ |
| 114 |
} while(0) |
| 115 |
|
| 116 |
#define import_ufunc() \ |
| 117 |
do {\ |
| 118 |
UFUNC_NOFPE\ |
| 119 |
if (_import_umath() < 0) {\ |
| 120 |
PyErr_Print();\ |
| 121 |
PyErr_SetString(PyExc_ImportError,\ |
| 122 |
"numpy.core.umath failed to import");\ |
| 123 |
}\ |
| 124 |
} while(0) |
| 86 |
|
125 |
|
| 87 |
#endif |
126 |
#endif |
| 88 |
""" |
127 |
""" |