Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added specific error messages when ink has incorrect number of bands #5504

Merged
merged 2 commits into from May 23, 2021

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