8000 Trio103: except Cancelled/BaseException must be re-raised by jakkdl · Pull Request #8 · python-trio/flake8-async · GitHub
[go: up one dir, main page]

Skip to content

Trio103: except Cancelled/BaseException must be re-raised #8

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

Merged
merged 17 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
updated comments
  • Loading branch information
jakkdl committed Jul 30, 2022
commit a41f00b92daff9d39ce6c52be5af0cb5a87ffdf2
4 changes: 2 additions & 2 deletions tests/test_flake8_trio.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ def test_trio103_104(self):
make_error(TRIO103, 47, 7),
make_error(TRIO103, 52, 7),
# nested exceptions
make_error(TRIO104, 67, 8), # weird case, unsure if error
make_error(TRIO104, 67, 8), # weird edge-case
make_error(TRIO103, 61, 7),
make_error(TRIO104, 92, 8),
# make_error(TRIO104, 94, 8), # TODO: not implemented
# make_error(TRIO104, 94, 8), # weird edge-case
# bare except
make_error(TRIO103, 97, 0),
# multi-line
Expand Down
6 changes: 3 additions & 3 deletions tests/trio103_104.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
except ValueError:
raise e
except:
raise e # error?
raise e # error: though sometimes okay
except BaseException: # safe
try:
pass
Expand All @@ -91,7 +91,7 @@
except ValueError as g:
raise g # error
except BaseException as h:
raise h # error ?
raise h # error? currently treated as safe
raise e
# bare except, equivalent to `except baseException`
except: # error
Expand Down Expand Up @@ -145,7 +145,7 @@ def foo():
return # error


# TODO: don't avoid re-raise with continue/break
# don't avoid re-raise with continue/break
while True:
try:
pass
Expand Down
0