Skip to content

Commit 9b3f423

Browse files
committed
tools/pyboard: Tighten up Pyboard object closure on errors.
Some "device" implementations may be sensitive to this.
1 parent ca81c3a commit 9b3f423

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/pyboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,15 @@ def main():
300300
pyb.enter_raw_repl()
301301
except PyboardError as er:
302302
print(er)
303+
pyb.close()
303304
sys.exit(1)
304305

305306
def execbuffer(buf):
306307
try:
307308
ret, ret_err = pyb.exec_raw(buf, timeout=None, data_consumer=stdout_write_bytes)
308309
except PyboardError as er:
309310
print(er)
311+
pyb.close()
310312
sys.exit(1)
311313
except KeyboardInterrupt:
312314
sys.exit(1)

0 commit comments

Comments
 (0)