mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Tools: Handle IO error in idf.py output capturing
Closes https://github.com/espressif/esp-idf/issues/9649
This commit is contained in:
parent
15ec31e902
commit
9307a932ad
@ -240,10 +240,14 @@ class RunTool:
|
||||
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''
|
||||
|
Loading…
x
Reference in New Issue
Block a user