Skip to content

Fix SyntaxWarning from return in finally block (PEP 765)#62

Merged
santoru merged 1 commit into
masterfrom
fix/return-in-finally-block
Mar 7, 2026
Merged

Fix SyntaxWarning from return in finally block (PEP 765)#62
santoru merged 1 commit into
masterfrom
fix/return-in-finally-block

Conversation

@santoru

@santoru santoru commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Python 3.14 raises SyntaxWarning for 'return' inside a 'finally' block as it can mask exceptions and obscures control flow. The finally block in normalize() was used solely to return target unconditionally, which is equivalent to a plain return after the try/except.

Fixes #56

Python 3.14 raises SyntaxWarning for 'return' inside a 'finally' block
as it can mask exceptions and obscures control flow. The finally block
in normalize() was used solely to return target unconditionally, which
is equivalent to a plain return after the try/except.

Fixes #56

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@santoru santoru merged commit 3410201 into master Mar 7, 2026
5 checks passed
@santoru santoru deleted the fix/return-in-finally-block branch March 7, 2026 06:27
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.

Disrespects PEP 765

1 participant