Skip to content

Commit

Permalink
Merge branch 'fix/impr_idf_hint_error_handling' into 'master'
Browse files Browse the repository at this point in the history
Tools: Handle IO error in idf.py output capturing

Closes IDFGH-8153

See merge request espressif/esp-idf!19926
  • Loading branch information
dobairoland committed Sep 5, 2022
2 parents 6193e4c + 9307a93 commit a565f06
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/idf_py_actions/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,14 @@ def print_progression(output: str) -> None:
print(fit_text_in_terminal(output.strip('\n\r')), end='', file=output_stream)

async def read_stream() -> Optional[str]:
output_b = await input_stream.readline()
if not output_b:
try:
output_b = await input_stream.readline()
return output_b.decode(errors='ignore')
except (asyncio.LimitOverrunError, asyncio.IncompleteReadError) as e:
print(e, file=sys.stderr)
return None
except AttributeError:
return None
return output_b.decode(errors='ignore')

async def read_interactive_stream() -> Optional[str]:
buffer = b''
Expand Down

0 comments on commit a565f06

Please sign in to comment.