Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixed: specified exception type in cbook.py#31489

Merged
QuLogic merged 2 commits intomatplotlib:mainfrom
Jaylon0418:fix/cbook-exception-handling
Apr 17, 2026
Merged

Fixed: specified exception type in cbook.py#31489
QuLogic merged 2 commits intomatplotlib:mainfrom
Jaylon0418:fix/cbook-exception-handling

Conversation

@Jaylon0418
Copy link
Copy Markdown
Contributor

PR summary

Solved the Fixme comment in cbook.py, for a more specified exception type. Replaced except Exception with except(TypeError, ValueError). The change is made based on how np.isinfinite() works.

AI Disclosure

I used AI for finding the problem, but wrote it by hand(literally one line:)

PR checklist

…xception with except(TypeError, ValueError) as the fixme comment addressed
Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

While I'm not a aware of an input that raises ValueError, those two are the only ones that semantically would make sense. Everything else should not be silently dropped so this makes sense.

@QuLogic QuLogic added this to the v3.11.0 milestone Apr 17, 2026
@QuLogic QuLogic merged commit 51a3541 into matplotlib:main Apr 17, 2026
50 of 51 checks passed
@github-project-automation github-project-automation Bot moved this from Needs decision to Merged in First Time Contributors Apr 17, 2026
@QuLogic
Copy link
Copy Markdown
Member

QuLogic commented Apr 17, 2026

Thanks @Jaylon0418! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants