NUMPY_API * Useful to pass as converter function for O& processing in * PyArgs_ParseTuple for output arrays */
| 60 | * PyArgs_ParseTuple for output arrays |
| 61 | */ |
| 62 | NPY_NO_EXPORT int |
| 63 | PyArray_OutputConverter(PyObject *object, PyArrayObject **address) |
| 64 | { |
| 65 | if (object == NULL || object == Py_None) { |
| 66 | *address = NULL; |
| 67 | return NPY_SUCCEED; |
| 68 | } |
| 69 | if (PyArray_Check(object)) { |
| 70 | *address = (PyArrayObject *)object; |
| 71 | return NPY_SUCCEED; |
| 72 | } |
| 73 | else { |
| 74 | PyErr_SetString(PyExc_TypeError, |
| 75 | "output must be an array"); |
| 76 | *address = NULL; |
| 77 | return NPY_FAIL; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | |
| 82 | /* |
no outgoing calls
no test coverage detected