From e839504b509f938720f1eec5b195ec0a8a06156c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20KUBLER?= <gregoire.kubler@proton.me> Date: Tue, 16 Jul 2024 11:26:56 +0200 Subject: [PATCH] fix : code quality --- aidge_core/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aidge_core/utils.py b/aidge_core/utils.py index 1dd28b506..b6890bc24 100644 --- a/aidge_core/utils.py +++ b/aidge_core/utils.py @@ -37,10 +37,6 @@ def template_docstring(template_keyword, text_to_replace): return dec -def enqueue_output(stream, queue): - for line in iter(stream.readline, ""): - queue.put(line) - stream.close() def run_command(command: List[str], cwd: pathlib.Path = None): @@ -76,6 +72,11 @@ def run_command(command: List[str], cwd: pathlib.Path = None): stdout_queue = queue.Queue() stderr_queue = queue.Queue() + def enqueue_output(stream, queue_to_append): + for line in iter(stream.readline, ""): + queue_to_append.put(line) + stream.close() + stdout_thread = threading.Thread( target=enqueue_output, args=(process.stdout, stdout_queue) ) -- GitLab