From e32d81520a29b62a1582ad96702a962c86d9f37f Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 13 Aug 2024 14:50:27 +0200 Subject: [PATCH] use "walrus" operator (didn't know about it, doh!) --- cmdeploy/src/cmdeploy/remote/_sshexec_bootstrap.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmdeploy/src/cmdeploy/remote/_sshexec_bootstrap.py b/cmdeploy/src/cmdeploy/remote/_sshexec_bootstrap.py index f5b4c083..443dfdd1 100644 --- a/cmdeploy/src/cmdeploy/remote/_sshexec_bootstrap.py +++ b/cmdeploy/src/cmdeploy/remote/_sshexec_bootstrap.py @@ -6,11 +6,7 @@ import traceback def _run_loop(cmd_channel): - while 1: - cmd = cmd_channel.receive() - if cmd is None: - break - + while cmd := cmd_channel.receive(): cmd_channel.send(_handle_one_request(cmd))