diff --git a/aidge_core/utils.py b/aidge_core/utils.py
index 1dd28b5062a63965924589dcfa08373b7834b324..b6890bc2432b29499d1b06e7229c8c524a36cb06 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)
     )