Skip to content

Commit

Permalink
seberg review actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmariasis committed Feb 1, 2020
1 parent d8f865f commit a0336e2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions numpy/core/src/multiarray/descriptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ static PyArray_Descr *
_convert_from_tuple(PyObject *obj, int align)
{
if (PyTuple_GET_SIZE(obj) != 2) {
PyErr_Format(PyExc_TypeError, "Tuple must have size 2, but has size %d", PyTuple_GET_SIZE(obj));
PyErr_Format(PyExc_TypeError,
"Tuple must have size 2, but has size %d",
PyTuple_GET_SIZE(obj));
return NULL;
}
PyArray_Descr *type = _convert_from_any(PyTuple_GET_ITEM(obj, 0), align);
Expand Down Expand Up @@ -432,7 +434,9 @@ _convert_from_array_descr(PyObject *obj, int align)
for (int i = 0; i < n; i++) {
PyObject *item = PyList_GET_ITEM(obj, i);
if (!PyTuple_Check(item) || (PyTuple_GET_SIZE(item) < 2)) {
PyErr_Format(PyExc_TypeError, "Field elements must be 2- or 3-tuples, got %R", item);
PyErr_Format(PyExc_TypeError,
"Field elements must be 2- or 3-tuples, got '%R'",
item);
goto fail;
}
PyObject *name = PyTuple_GET_ITEM(item, 0);
Expand All @@ -443,7 +447,8 @@ _convert_from_array_descr(PyObject *obj, int align)
else if (PyTuple_Check(name)) {
if (PyTuple_GET_SIZE(name) != 2) {
PyErr_Format(PyExc_TypeError,
"If a tuple, the first element of a field tuple must have two elements, not %d",
"If a tuple, the first element of a field tuple must have \
two elements, not %d",
PyTuple_GET_SIZE(name));
goto fail;
}
Expand All @@ -455,7 +460,9 @@ _convert_from_array_descr(PyObject *obj, int align)
}
}
else {
PyErr_SetString(PyExc_TypeError, "First element of field tuple is neither a tuple nor str");
PyErr_SetString(PyExc_TypeError,
"First element of field tuple is \
neither a tuple nor str");
goto fail;
}

Expand Down

0 comments on commit a0336e2

Please sign in to comment.