Skip to content

Commit

Permalink
PixelArray raise error assigning sequence to pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
ankith26 committed Mar 7, 2024
1 parent 9597f81 commit 69c7fc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src_c/pixelarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,12 @@ _pxarray_ass_item(pgPixelArrayObject *array, Py_ssize_t index, PyObject *value)
if (!tmparray) {
return -1;
}
if (!pgPixelArrayObject_Check(tmparray)) {
PyErr_SetString(
PyExc_ValueError,
"cannot assign a pixel sequence to a single pixel");
return -1;
}
retval =
_array_assign_sequence(tmparray, 0, tmparray->shape[0], value);
Py_DECREF(tmparray);
Expand Down

0 comments on commit 69c7fc4

Please sign in to comment.