From 1fc8b458616be643e47ee6a227689af4e79a7e64 Mon Sep 17 00:00:00 2001 From: Joram Agten Date: Tue, 9 Apr 2024 18:11:47 +0200 Subject: [PATCH] o_char and e_char are always empty, then returncode is None by line 282 o_char and e_char are always empty since `while o_char != b'':` and `while e_char != b'':` will have done their job --- builder/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builder/__init__.py b/builder/__init__.py index 3087690b..07d74dd7 100644 --- a/builder/__init__.py +++ b/builder/__init__.py @@ -206,9 +206,12 @@ def read(): r_beg = False newline = False last_line_len = 0 + o_char_seen = False + e_char_seen = False while p.poll() is None: o_char = p.stdout.read(1) while o_char != b'': + o_char_seen = True output_buffer += o_char if out_to_screen and not spinner and cmpl: if o_char == b'\n': @@ -263,6 +266,7 @@ def read(): e_char = p.stderr.read(1) while e_char != b'': + e_char_seen = True if out_to_screen and not spinner: try: sys.stderr.write(e_char.decode('utf-8')) @@ -275,7 +279,7 @@ def read(): if output_buffer.endswith(prompt): break - if not e_char and not o_char: + if not e_char_seen and not o_char_seen: break return output_buffer