refactor: ruff autofixes

This commit is contained in:
Mark Paronyan committed 2026-10-17 11:43:36 +03:00
1 parent 54139dced2
commit b7e6c02647
39 files changed
+76 -88

No files matched your search

+1 -1
View File
@@ -125,7 +125,7 @@ async def wait_for_file_creation(path, timeout=60):
return
await asyncio.sleep(0.5)
timeout -= 0.5
raise asyncio.TimeoutError()
raise TimeoutError()
def locking(f):
+1 -1
View File
@@ -66,7 +66,7 @@ async def _asyncio_open_serial_unix(path):
try:
# wait for VM to create the pipe file.
await wait_for_file_creation(path)
except asyncio.TimeoutError:
except TimeoutError:
raise NodeError(f'Pipe file "{path}" is missing')
output = SerialReaderWriterProtocol()
+1 -1
View File
@@ -147,7 +147,7 @@ class AsyncioSSHServer:
try:
process.stdout.write(data)
await asyncio.wait_for(process.stdout.drain(), timeout=BROADCAST_DRAIN_TIMEOUT)
except (OSError, ConnectionError, asyncio.TimeoutError, asyncssh.Error):
except (TimeoutError, OSError, ConnectionError, asyncssh.Error):
await self._disconnect_client(process)
except asyncio.CancelledError:
raise
+2 -2
View File
@@ -324,7 +324,7 @@ class AsyncioTelnetServer:
try:
connection.writer.write(data)
await asyncio.wait_for(connection.writer.drain(), timeout=BROADCAST_DRAIN_TIMEOUT)
except (OSError, ConnectionError, asyncio.TimeoutError) as e:
except (TimeoutError, OSError, ConnectionError) as e:
client_info = self._get_peername(network_writer)
log.debug(
"Error sending data to client %s: %s, closing and removing from connection table.",
@@ -352,7 +352,7 @@ class AsyncioTelnetServer:
log.debug("Sending keepalive to client %s", client_info)
connection.writer.send_iac(IAC + NOP)
await asyncio.wait_for(connection.writer.drain(), timeout=BROADCAST_DRAIN_TIMEOUT)
except (OSError, ConnectionError, asyncio.TimeoutError) as e:
except (TimeoutError, OSError, ConnectionError) as e:
log.debug(
"Keepalive failed for client %s: %s, closing connection.",
client_info,
+1 -1
View File
@@ -59,7 +59,7 @@ class NotificationQueue(asyncio.Queue):
try:
(action, msg, kwargs) = await asyncio.wait_for(super().get(), timeout - (now - self._last_ping))
return (action, msg, kwargs)
except asyncio.TimeoutError:
except TimeoutError:
continue # the ping deadline has been reached
def _ping(self):