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

Changed ImageMorph incorrect mode errors to ValueError #5414

Merged
merged 1 commit into from Apr 23, 2021

Conversation

radarhere
Copy link
Member

ImageMorph features these two lines three times.

if image.mode != "L":
raise Exception("Image must be binary, meaning it must use mode L")

Exception is very generic, and L is not the only black and white mode that we have - there is also '1'.

This PR suggests changing it instead to

raise ValueError("Image mode must be L")

@hugovk hugovk merged commit b09a921 into python-pillow:master Apr 23, 2021
@radarhere radarhere deleted the morph branch April 23, 2021 22:21
radarhere added a commit to radarhere/Pillow that referenced this pull request May 1, 2021
radarhere added a commit to radarhere/Pillow that referenced this pull request May 1, 2021
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.

None yet

2 participants