diff --git a/fpga/build_images.py b/fpga/build_images.py index 3be5a1298..6a71e3fa9 100755 --- a/fpga/build_images.py +++ b/fpga/build_images.py @@ -144,13 +144,10 @@ class Build: stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) - while True: - line = await proc.stdout.readline() - if not line: - break - line = line.decode('utf-8').strip() - - self.scan_log_line(line) + await asyncio.gather( + self.process_stream(proc.stdout), + self.process_stream(proc.stderr), + ) self.synth_done() self.build_done() @@ -166,6 +163,15 @@ class Build: self.elapsed_time = datetime.datetime.now() - self.start_time + async def process_stream(self, stream): + while True: + line = await stream.readline() + if not line: + break + line = line.decode('utf-8').strip() + + self.scan_log_line(line) + def scan_log_line(self, line): pass