Lifted from numarray */ TODO: not documented */ NUMPY_API PyArray_IntTupleFromIntp */
| 1329 | PyArray_IntTupleFromIntp |
| 1330 | */ |
| 1331 | NPY_NO_EXPORT PyObject * |
| 1332 | PyArray_IntTupleFromIntp(int len, npy_intp const *vals) |
| 1333 | { |
| 1334 | int i; |
| 1335 | PyObject *intTuple = PyTuple_New(len); |
| 1336 | |
| 1337 | if (!intTuple) { |
| 1338 | goto fail; |
| 1339 | } |
| 1340 | for (i = 0; i < len; i++) { |
| 1341 | PyObject *o = PyArray_PyIntFromIntp(vals[i]); |
| 1342 | if (!o) { |
| 1343 | Py_DECREF(intTuple); |
| 1344 | intTuple = NULL; |
| 1345 | goto fail; |
| 1346 | } |
| 1347 | PyTuple_SET_ITEM(intTuple, i, o); |
| 1348 | } |
| 1349 | |
| 1350 | fail: |
| 1351 | return intTuple; |
| 1352 | } |
no test coverage detected