* Tries to convert 'o' into an npy_intp interpreted as an * index. Returns 1 if it was successful, 0 otherwise. Does * not set an exception. */
| 29 | * not set an exception. |
| 30 | */ |
| 31 | static int |
| 32 | coerce_index(PyObject *o, npy_intp *v) |
| 33 | { |
| 34 | *v = PyArray_PyIntAsIntp(o); |
| 35 | |
| 36 | if ((*v) == -1 && PyErr_Occurred()) { |
| 37 | PyErr_Clear(); |
| 38 | return 0; |
| 39 | } |
| 40 | return 1; |
| 41 | } |
| 42 | |
| 43 | /* |
| 44 | * This function converts one element of the indexing tuple |
no test coverage detected