Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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
  • Loading branch information
cheops authored Apr 9, 2024
commit 1fc8b458616be643e47ee6a227689af4e79a7e64
6 changes: 5 additions & 1 deletion builder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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'))
Expand All @@ -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
Expand Down