| 3490 | } |
| 3491 | |
| 3492 | static int |
| 3493 | _check_has_fields(PyArray_Descr *self) |
| 3494 | { |
| 3495 | if (!PyDataType_HASFIELDS(self)) { |
| 3496 | PyErr_Format(PyExc_KeyError, "There are no fields in dtype %S.", self); |
| 3497 | return -1; |
| 3498 | } |
| 3499 | else { |
| 3500 | return 0; |
| 3501 | } |
| 3502 | } |
| 3503 | |
| 3504 | static PyObject * |
| 3505 | _subscript_by_name(PyArray_Descr *self, PyObject *op) |