-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Rule TRY302 raised while the re-raise changes the error #4548
Comments
Good catch! |
Would you like to work on it? |
I'd like to, but have no experience writing Rust, so probably can't without some pointers. I assume fixing this requires changes to the logic here: https://github.com/charliermarsh/ruff/blob/fc63c6f2e260760963c5fdea2d9d4e0cf38ec58a/crates/ruff/src/rules/tryceratops/rules/useless_try_except.rs#L52-L55 And add a new test case(s) here: https://github.com/charliermarsh/ruff/blob/fc63c6f2e260760963c5fdea2d9d4e0cf38ec58a/crates/ruff/resources/test/fixtures/tryceratops/TRY302.py#L4 |
You can look up |
Thank you for the hint, PR is up. |
With code like the example below I got this unexpected error:
Although the error is immediately re-raised, it is modified, the causes are removed.
Code to reproduce:
Enabled ALL settings.
Version: ruff 0.0.269
The text was updated successfully, but these errors were encountered: