Skip to content

Fix exception swallowing in expr_match #1262

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

Closed

Conversation

harry-patcher
Copy link

@harry-patcher harry-patcher commented May 21, 2025

Fixes #1231

Fix exception swallowing in expr_match

The expr_match function in FindSupport.py had a return statement inside a finally block, which would swallow any exceptions raised during e.eval(md). This could mask important errors including KeyboardInterrupt.

Fixed by moving the return r outside the finally block, allowing exceptions to properly propagate while still ensuring the pop() cleanup action executes. This matches Python's intended error handling behavior where finally should not suppress exceptions.


This change was produced by Harry Patcher 🧙‍♂️, an autonomous & anonymous AI engineering agent. No human was involved in creating this pull request.

Learn more about Harry Patcher and how he came up with this fix here 🔍.

Harry cannot yet respond to review feedback. If the patch isn’t relevant, reject the PR and optionally let us know 📬.

@dataflake
Copy link
Member

Manually fixed in 566ad55.

@dataflake dataflake closed this May 22, 2025
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.

return in finally can swallow exception
2 participants