| 1487 | } |
| 1488 | |
| 1489 | static PyObject * |
| 1490 | npyiter_next(NewNpyArrayIterObject *self) |
| 1491 | { |
| 1492 | if (self->iter == NULL || self->iternext == NULL || |
| 1493 | self->finished) { |
| 1494 | return NULL; |
| 1495 | } |
| 1496 | |
| 1497 | /* |
| 1498 | * Use the started flag for the Python iteration protocol to work |
| 1499 | * when buffering is enabled. |
| 1500 | */ |
| 1501 | if (self->started) { |
| 1502 | if (!self->iternext(self->iter)) { |
| 1503 | /* |
| 1504 | * A casting error may be set here (or no error causing a |
| 1505 | * StopIteration). Buffers may only be cleaned up later. |
| 1506 | */ |
| 1507 | self->finished = 1; |
| 1508 | return NULL; |
| 1509 | } |
| 1510 | |
| 1511 | /* If there is nesting, the nested iterators should be reset */ |
| 1512 | if (npyiter_resetbasepointers(self) != NPY_SUCCEED) { |
| 1513 | return NULL; |
| 1514 | } |
| 1515 | } |
| 1516 | self->started = 1; |
| 1517 | |
| 1518 | return npyiter_value_get(self, NULL); |
| 1519 | }; |
| 1520 | |
| 1521 | static PyObject * |
| 1522 | npyiter_shape_get(NewNpyArrayIterObject *self, void *NPY_UNUSED(ignored)) |
nothing calls this directly
no test coverage detected