From 03243e9102216e21b3657b776889e657386308a9 Mon Sep 17 00:00:00 2001 From: Dmitry Chumak Date: Wed, 14 Dec 2022 23:59:14 +0300 Subject: [PATCH] refactored unnecessary for-loop --- main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.py b/main.py index ca01469..648ddce 100644 --- a/main.py +++ b/main.py @@ -21,9 +21,7 @@ def exec_command(command): ssh_stdin.close() # убираем лишние переносы строки из вывода - clean_lines = [] - for line in ssh_stdout.readlines(): - clean_lines.append(line.strip()) + clean_lines = [line.strip() for line in ssh_stdout.readlines()] return clean_lines