Skip to content

Python 3.14 SyntaxWarnings: 'return' in a 'finally' block #299

Description

@rsolanodev

Description

When running with Python 3.14, Rele emits multiple SyntaxWarning messages about return statements inside finally blocks:

/usr/local/lib/python3.14/site-packages/rele/worker.py:38: SyntaxWarning: 'return' in a 'finally' block
  return result

Why This Matters

Using return inside a finally block is problematic because:

  1. It silently swallows any exceptions that were raised in the try block
  2. It masks the original exception, making debugging difficult
  3. Python 3.14 now explicitly warns about this pattern

Affected Files

rele/rele/worker.py (line 38)

Proposed Fix

Refactor the code to move the return statements outside of the finally blocks while preserving the intended behavior.

Environment

  • Python version: 3.14
  • rele version: latest (main branch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions