Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Aug 15, 2024
1 parent 8f424b3 commit 6f646d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,26 @@ async def func():
async def func():
async with asyncio.timeout(delay=0.2), asyncio.timeout(delay=0.2):
...



# Don't trigger for blocks with a yield statement
async def foo():
with trio.fail_after(1):
yield


async def foo(): # even if only one branch contains a yield, we skip the lint
with trio.fail_after(1):
if something:
...
else:
yield


# https://github.com/astral-sh/ruff/issues/12873
@asynccontextmanager
async def good_code():
with anyio.fail_after(10):
# There's no await keyword here, but we presume that there
# will be in the caller we yield to, so this is safe.
yield
yield
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,4 @@ ASYNC100.py:90:5: ASYNC100 A `with asyncio.timeout(...):` context does not conta
| _____^
91 | | ...
| |___________^ ASYNC100
92 |
93 | # Don't trigger for blocks with a yield statement
|

0 comments on commit 6f646d2

Please sign in to comment.