diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ba16bc4d9..e06d1c7ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.1 + rev: v0.8.2 hooks: - id: ruff types: [file] diff --git a/notes-to-self/aio-guest-test.py b/notes-to-self/aio-guest-test.py index 3c607d028..7bf07d5dd 100644 --- a/notes-to-self/aio-guest-test.py +++ b/notes-to-self/aio-guest-test.py @@ -27,7 +27,7 @@ async def trio_main(): to_trio, from_aio = trio.open_memory_channel(float("inf")) from_trio = asyncio.Queue() - _task_ref = asyncio.create_task(aio_pingpong(from_trio, to_trio)) + task_ref = asyncio.create_task(aio_pingpong(from_trio, to_trio)) from_trio.put_nowait(0) @@ -37,7 +37,7 @@ async def trio_main(): from_trio.put_nowait(n + 1) if n >= 10: return - del _task_ref + del task_ref async def aio_pingpong(from_trio, to_trio): diff --git a/src/trio/_file_io.py b/src/trio/_file_io.py index 5a612ffb0..5307fb942 100644 --- a/src/trio/_file_io.py +++ b/src/trio/_file_io.py @@ -467,7 +467,7 @@ async def open_file( :func:`trio.Path.open` """ - _file = wrap_file( + file_ = wrap_file( await trio.to_thread.run_sync( io.open, file, @@ -480,7 +480,7 @@ async def open_file( opener, ), ) - return _file + return file_ def wrap_file(file: FileT) -> AsyncIOWrapper[FileT]: diff --git a/src/trio/_socket.py b/src/trio/_socket.py index 259992b71..d92add290 100644 --- a/src/trio/_socket.py +++ b/src/trio/_socket.py @@ -1283,10 +1283,10 @@ async def sendto(self, *args: object) -> int: @_wraps(_stdlib_socket.socket.sendmsg, assigned=(), updated=()) async def sendmsg( self, - __buffers: Iterable[Buffer], - __ancdata: Iterable[tuple[int, int, Buffer]] = (), - __flags: int = 0, - __address: AddressFormat | None = None, + buffers: Iterable[Buffer], + ancdata: Iterable[tuple[int, int, Buffer]] = (), + flags: int = 0, + address: AddressFormat | None = None, ) -> int: """Similar to :meth:`socket.socket.sendmsg`, but async. @@ -1294,15 +1294,15 @@ async def sendmsg( available. """ - if __address is not None: - __address = await self._resolve_address_nocp(__address, local=False) + if address is not None: + address = await self._resolve_address_nocp(address, local=False) return await self._nonblocking_helper( _core.wait_writable, _stdlib_socket.socket.sendmsg, - __buffers, - __ancdata, - __flags, - __address, + buffers, + ancdata, + flags, + address, ) ################################################################ diff --git a/test-requirements.txt b/test-requirements.txt index 490b41ea5..87b3c581e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -113,7 +113,7 @@ pytest==8.3.3 # via -r test-requirements.in requests==2.32.3 # via sphinx -ruff==0.8.1 +ruff==0.8.2 # via -r test-requirements.in sniffio==1.3.1 # via -r test-requirements.in