From 6bafcb244bd6cd031ac9b65fce8a2a939698ecaa Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 2 Nov 2022 16:31:02 +0100 Subject: ... --- modules/borgsnap/borgsnap/borgsnap/__main__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/borgsnap/borgsnap/borgsnap/__main__.py b/modules/borgsnap/borgsnap/borgsnap/__main__.py index 80bf511d..91144780 100644 --- a/modules/borgsnap/borgsnap/borgsnap/__main__.py +++ b/modules/borgsnap/borgsnap/borgsnap/__main__.py @@ -274,12 +274,10 @@ def create(*, snapshot, target, archive_prefix, dry_run): for rfd, event in events: if event & select.POLLIN: if rfd == proc.stdout.fileno(): - line = proc.stdout.readline() - if len(line) > 0: + if line := proc.stdout.readline(): stdout_logger.info(line[:-1]) if rfd == proc.stderr.fileno(): - line = proc.stderr.readline() - if len(line) > 0: + if line := proc.stderr.readline(): stderr_logger.info(line[:-1]) if event & select.POLLHUP: poll.unregister(rfd) -- cgit v1.2.3