Skip to content
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

TRY400 triggers multiple times in case of nested try..except blocks #8770

Closed
ThiefMaster opened this issue Nov 19, 2023 · 0 comments · Fixed by #8772
Closed

TRY400 triggers multiple times in case of nested try..except blocks #8770

ThiefMaster opened this issue Nov 19, 2023 · 0 comments · Fixed by #8772
Labels
bug Something isn't working

Comments

@ThiefMaster
Copy link
Contributor

try:
    ...
except E1 as exc:
    ...
    try:
        ...
    except E2:
        try:
            ...
        except E3:
            logger.error('foo')
$ ruff --isolated --select TRY400 --no-cache rufftest/ruff_sample.py
rufftest/ruff_sample.py:11:13: TRY400 Use `logging.exception` instead of `logging.error`
rufftest/ruff_sample.py:11:13: TRY400 Use `logging.exception` instead of `logging.error`
rufftest/ruff_sample.py:11:13: TRY400 Use `logging.exception` instead of `logging.error`
Found 3 errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants