Skip to content

Commit

Permalink
feat: code check
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Nov 5, 2024
1 parent 8b3a1b6 commit 5debbb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions asgi_tools/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def aio_sleep(seconds: float = 0) -> Awaitable:
"""Return sleep coroutine."""

if trio_installed and current_async_library() == "trio":
return trio_sleep(seconds) # noqa: TRIO105
return trio_sleep(seconds) # noqa: ASYNC105

if curio_installed and current_async_library() == "curio":
return curio_sleep(seconds)
Expand Down Expand Up @@ -110,15 +110,15 @@ async def aio_spawn(fn: Callable[..., Awaitable], *args, **kwargs):


@asynccontextmanager
async def aio_timeout(timeout: float): # noqa: TRIO109
async def aio_timeout(timeout: float): # noqa: ASYNC109
"""Fail after the given timeout."""
if not timeout:
yield
return

if trio_installed and current_async_library() == "trio":
try:
with trio_fail_after(timeout): # noqa: TRIO100
with trio_fail_after(timeout):
yield

except TooSlowError:
Expand Down
2 changes: 1 addition & 1 deletion asgi_tools/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def on_headers_finished(self, *_):
self.partdata = f = open(filename, "wb+") # noqa: SIM115, PTH123

else:
self.partdata = f = SpooledTemporaryFile(self.file_memory_limit)
self.partdata = f = SpooledTemporaryFile(self.file_memory_limit) # noqa: SIM115
f._file.name = options["filename"] # type: ignore[]

f.content_type = self.headers[b"content-type"].decode(self.charset)
Expand Down

0 comments on commit 5debbb6

Please sign in to comment.