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 messages to errors #7480

Merged
merged 2 commits into from Oct 19, 2023
Merged

Added messages to errors #7480

merged 2 commits into from Oct 19, 2023

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
52 of 53 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants