Skip to content

Commit

Permalink
tools/mpremote: Fix use of stdout_write_bytes function.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jun 2, 2023
1 parent ef497dc commit a61d40e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tools/mpremote/mpremote/commands.py
Expand Up @@ -5,7 +5,7 @@
import serial.tools.list_ports

from .transport import TransportError
from .transport_serial import SerialTransport
from .transport_serial import SerialTransport, stdout_write_bytes


class CommandError(Exception):
Expand Down Expand Up @@ -79,7 +79,7 @@ def do_disconnect(state, _args=None):
state.transport.exit_raw_repl()
except OSError:
# Ignore any OSError exceptions when shutting down, eg:
# - pyboard.filesystem_command will close the connection if it had an error
# - filesystem_command will close the connection if it had an error
# - umounting will fail if serial port disappeared
pass
state.transport.close()
Expand Down Expand Up @@ -190,11 +190,9 @@ def _do_execbuffer(state, buf, follow):
try:
state.transport.exec_raw_no_follow(buf)
if follow:
ret, ret_err = state.transport.follow(
timeout=None, data_consumer=pyboard.stdout_write_bytes
)
ret, ret_err = state.transport.follow(timeout=None, data_consumer=stdout_write_bytes)
if ret_err:
pyboard.stdout_write_bytes(ret_err)
stdout_write_bytes(ret_err)
sys.exit(1)
except TransportError as er:
print(er)
Expand Down

0 comments on commit a61d40e

Please sign in to comment.