tools/pyboard.py: Add timeout argument to Pyboard.exec_/exec.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2025-07-17 15:27:39 +10:00
parent b7e734bfb7
commit cc774c3daf

View file

@ -530,8 +530,8 @@ class Pyboard:
return ret return ret
# In Python3, call as pyboard.exec(), see the setattr call below. # In Python3, call as pyboard.exec(), see the setattr call below.
def exec_(self, command, data_consumer=None): def exec_(self, command, timeout=10, data_consumer=None):
ret, ret_err = self.exec_raw(command, data_consumer=data_consumer) ret, ret_err = self.exec_raw(command, timeout, data_consumer)
if ret_err: if ret_err:
raise PyboardError("exception", ret, ret_err) raise PyboardError("exception", ret, ret_err)
return ret return ret