Skip to content

Conversation

@radarhere
Copy link
Member

Resolves #5503

The issue requests that the error if ink has an incorrect number of bands be clearer than the default "TypeError: function takes exactly 1 argument (3 given)".

This PR adds error messages similar to

PyExc_TypeError, "color must be int or single-element tuple");

not just for 1 band images as mentioned in the issue, but also for other similar situations in the same C function.

While I'm here, I'm also replacing

if (PyTuple_Check(color) && PyTuple_Size(color) == 1) {

with PyTuple_Check(color) && PyTuple_GET_SIZE(color) == 1, since we have already performed the error checking with PyTuple_Check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cryptic error message if you draw in color on a grayscale image

2 participants