diff options
| author | Damien George <damien@micropython.org> | 2023-06-02 18:01:47 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-06-02 18:03:16 +1000 |
| commit | a61d40e5e80e33172b41961ee5dcad6fb9a1f4a9 (patch) | |
| tree | 457e09de3900f56a600c7c0523fa83622a4adbe0 | |
| parent | ef497dc9243919c44c22b412f46143d78a6cdd3f (diff) | |
tools/mpremote: Fix use of stdout_write_bytes function.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | tools/mpremote/mpremote/commands.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/mpremote/mpremote/commands.py b/tools/mpremote/mpremote/commands.py index 9e05aca37..45acb8da1 100644 --- a/tools/mpremote/mpremote/commands.py +++ b/tools/mpremote/mpremote/commands.py @@ -5,7 +5,7 @@ import tempfile 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): @@ -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() @@ -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) |
