Skip to content

Conversation

@radarhere
Copy link
Member

In main, lint has started insisting that "Built-in Exceptions must not be thrown without being called" and "Built-in Exceptions must have a useful message" - https://github.com/python-pillow/Pillow/actions/runs/6570025729/job/17846816725#step:7:63

This PR adds messages to errors when they are raised, and replaces an error raised in the tests with a failed assertion.

Comment on lines 29 to 30
if rc:
raise OSError
assert False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work/be clearer?

- if rc: - raise OSError + assert not rc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that also works. I've made that change.

@hugovk hugovk merged commit a10dec0 into python-pillow:main Oct 19, 2023
@radarhere radarhere deleted the lint branch October 19, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants