mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Tools: Handle IO error in idf.py output capturing
Closes https://github.com/espressif/esp-idf/issues/9649
This commit is contained in:
@ -246,10 +246,14 @@ class RunTool:
|
|||||||
print(fit_text_in_terminal(output.strip('\n\r')), end='', file=output_stream)
|
print(fit_text_in_terminal(output.strip('\n\r')), end='', file=output_stream)
|
||||||
|
|
||||||
async def read_stream() -> Optional[str]:
|
async def read_stream() -> Optional[str]:
|
||||||
output_b = await input_stream.readline()
|
try:
|
||||||
if not output_b:
|
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 None
|
||||||
return output_b.decode(errors='ignore')
|
|
||||||
|
|
||||||
async def read_interactive_stream() -> Optional[str]:
|
async def read_interactive_stream() -> Optional[str]:
|
||||||
buffer = b''
|
buffer = b''
|
||||||
|
Reference in New Issue
Block a user