commit | bc88b9250e9cd93aa56ed021ff2c4405f4c3875c | [log] [tgz] |
---|---|---|
author | Chris Liechti <cliechti@gmx.net> | Mon Nov 23 04:52:03 2020 +0100 |
committer | Chris Liechti <cliechti@gmx.net> | Mon Nov 23 04:52:03 2020 +0100 |
tree | 6f7c6d0a1cb866227f05d2835d30ae9da48c9894 | |
parent | 54a6b00a7ce200755e0cde0fc3f2ae0dbc2e723a [diff] [blame] |
spy: ensure bytes in write()
diff --git a/serial/urlhandler/protocol_spy.py b/serial/urlhandler/protocol_spy.py index 92aaa2e..67c700b 100644 --- a/serial/urlhandler/protocol_spy.py +++ b/serial/urlhandler/protocol_spy.py
@@ -26,6 +26,7 @@ import time import serial +from serial.serialutil import to_bytes try: import urlparse @@ -200,6 +201,7 @@ return ''.join([parts.netloc, parts.path]) def write(self, tx): + tx = to_bytes(tx) self.formatter.tx(tx) return super(Serial, self).write(tx)