From b981eab5aa9f5eb5bc5b5add66d5e4683f7c6d14 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 21 Dec 2023 10:27:32 +0200 Subject: [PATCH] Update Ruff, simplify condition flagged by it Signed-off-by: Aarni Koskela --- .github/workflows/ci.yml | 2 +- docker/models/containers.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 127d5b682..628c53504 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-python@v4 with: python-version: '3.x' - - run: pip install -U ruff==0.0.284 + - run: pip install -U ruff==0.1.8 - name: Run ruff run: ruff docker tests diff --git a/docker/models/containers.py b/docker/models/containers.py index 4725d6f6f..32676bb85 100644 --- a/docker/models/containers.py +++ b/docker/models/containers.py @@ -903,9 +903,9 @@ def run(self, image, command=None, stdout=True, stderr=False, container, exit_status, command, image, out ) - return out if stream or out is None else b''.join( - [line for line in out] - ) + if stream or out is None: + return out + return b''.join(out) def create(self, image, command=None, **kwargs): """