-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of global state in fail
and warn
#35
Get rid of global state in fail
and warn
#35
Conversation
After the latest yak-shaving, the diff for this PR is now greatly reduced. |
This test must be updated nevertheless when warnings get line numbers.
Victor had some remarks about this PR; I'll try to address them tomorrow:
|
Come to think of it, that is also a concern with the current code; this PR does not alter the status quo. |
I wrote a different approach: python#114752 Maybe some of these changes are still relevent with my change, I didn't dig into the code yet. |
Upstreamed as python#115510 |
Here's an experiment I thought of earlier today, as a step towards error handling without global state. One of the biggest pains wrt. getting rid of the
clinic
global is thatfail
depends on it too much. So here's the experiment:warn_or_fail
It is a crude change, but it kind of works, and I think it might be an improvement (if polished a little bit).
Side-effects:
IMO, we should just use a variety of custom exceptions, catch these during parsing, format the error message and reraise it (for either the CLI or the test suite to catch).