Skip to content

fix: replace bare except with except Exception in parse_dataclass#9088

Open
harshadkhetpal wants to merge 2 commits intomarimo-team:mainfrom
harshadkhetpal:fix/bare-except-parse-dataclass
Open

fix: replace bare except with except Exception in parse_dataclass#9088
harshadkhetpal wants to merge 2 commits intomarimo-team:mainfrom
harshadkhetpal:fix/bare-except-parse-dataclass

Conversation

@harshadkhetpal
Copy link
Copy Markdown

Summary

Replace bare except: with except Exception: in marimo/_utils/parse_dataclass.py.

Bare except: catches all exceptions including SystemExit, KeyboardInterrupt, and GeneratorExit, which should generally not be caught. In this case the handler immediately re-raises, so narrowing to Exception preserves the intent while following Python best practices (PEP 8).

Change:

# Before
except:
    raise

# After
except Exception:
    raise

Testing

No behavior change — the except clause still catches and re-raises all standard exceptions.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 7, 2026 5:54pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

1 participant