Skip to content

gladevcp: 'return' inside finally in gtk_action.py swallows exceptions #4067

@grandixximo

Description

@grandixximo

lib/python/gladevcp/gtk_action.py:312 has return npath inside a finally: block. A return in finally swallows any in-flight exception and overrides earlier returns, hiding errors from the try/except above.

        finally:
            try:
                outfile.close()
            except:
                pass
            return npath   # <- swallows exceptions, overrides earlier return

Fix: move return npath out of the finally:. Surfaced as a SyntaxWarning: 'return' in a 'finally' block while running the ui-smoke GUIs (#4054).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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