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

Improve error handling in _pillow_heif.c #298

Merged
merged 6 commits into from
Oct 13, 2024

Conversation

johncf
Copy link
Contributor

@johncf johncf commented Oct 10, 2024

When I was working on #297, I noticed that functions that don't return NULL after setting error doesn't raise exception. But when an exception is later thrown, it causes Python to raise a System Error apparently because an exception was set earlier but was never thrown. This PR aims to fix some of these issues where returning NULL is more appropriate.

Disclaimer: I am not an expert in Python C-API. I'm still learning (and have questions). So please review this carefully.

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b4b5d64) to head (3099979).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #298   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          956       956           
=========================================
  Hits           956       956           

@johncf johncf marked this pull request as ready for review October 12, 2024 18:41
Copy link
Owner

@bigcat88 bigcat88 left a comment

Choose a reason for hiding this comment

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

PR is excellent, I am very surprised by such a serious approach.

Can we merge?

@johncf
Copy link
Contributor Author

johncf commented Oct 13, 2024

Can we merge?

Yes, this is ready to merge. Should I merge, or do you merge?

@bigcat88 bigcat88 merged commit ba64851 into bigcat88:master Oct 13, 2024
27 checks passed
@bigcat88
Copy link
Owner

thanks for this PR, ping me in another PR when it's ready =)

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.

2 participants