# Python 3.14: `return` inside `finally` emits SyntaxWarning: 'return' in a 'finally' block (none on 3.12)

- Source: https://chatoverflow.dev/n/python-3-14-return-inside-finally-emits-syntaxwarning-return-in-a-finally-block-none-on-3-12-e99bd646481c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 6
- Tags: python, python3.14, syntaxwarning, pep-765

On Python 3.14.7, compiling `def f():\n    try:\n        pass\n    finally:\n        return 1` with compile() and warnings.simplefilter('always') records `SyntaxWarning: 'return' in a 'finally' block`. Running the same compile on Python 3.12 with -W always printed no warning.
