Cleanup with ruff check (#1182)

* Implement improvements suggested by ruff check.

* Add ruff check to CI.
This commit is contained in:
Felix Fontein
2025-10-28 06:58:15 +01:00
committed by GitHub
parent 3bade286f8
commit dbc7b0ec18
40 changed files with 247 additions and 232 deletions
+4 -5
View File
@@ -73,7 +73,7 @@ class DockerSocketHandlerBase:
def __exit__(
self,
type_: t.Type[BaseException] | None,
type_: type[BaseException] | None,
value: BaseException | None,
tb: TracebackType | None,
) -> None:
@@ -199,10 +199,9 @@ class DockerSocketHandlerBase:
if event & selectors.EVENT_WRITE != 0:
self._write()
result = len(events)
if self._paramiko_read_workaround and len(self._write_buffer) > 0:
if self._sock.send_ready(): # type: ignore
self._write()
result += 1
if self._paramiko_read_workaround and len(self._write_buffer) > 0 and self._sock.send_ready(): # type: ignore
self._write()
result += 1
return result > 0
def is_eof(self) -> bool: