Skip to content

Commit dabce3e

Browse files
committedOct 31, 2024
Moved output file opening to before starting threads
1 parent a5d86a2 commit dabce3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎scripts/tests/linux/log_line_processing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ def __enter__(self):
9696
text=True,
9797
bufsize=1, # Enable line buffering for immediate output from subprocess
9898
)
99+
self.output_file = open(self.output_path, "wt", buffering=1) # Enable line buffering for immediate output
100+
self._write_to_file(f"### PROCESS START: {time.ctime()} ###\n")
99101
self.stdout_thread = threading.Thread(target=self._stdout_thread)
100102
self.stderr_thread = threading.Thread(target=self._stderr_thread)
101103
self.stdout_thread.start()
102104
self.stderr_thread.start()
103-
self.output_file = open(self.output_path, "wt", buffering=1) # Enable line buffering
104-
self._write_to_file(f"### PROCESS START: {time.ctime()} ###\n")
105105
return self
106106

107107
def __exit__(self, exception_type, exception_value, traceback):

0 commit comments

Comments
 (0)