diff options
author | Chris Liechti <cliechti@gmx.net> | 2020-11-23 04:52:03 +0100 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2020-11-23 04:52:03 +0100 |
commit | bc88b9250e9cd93aa56ed021ff2c4405f4c3875c (patch) | |
tree | 6f7c6d0a1cb866227f05d2835d30ae9da48c9894 | |
parent | 54a6b00a7ce200755e0cde0fc3f2ae0dbc2e723a (diff) | |
download | pyserial-git-bc88b9250e9cd93aa56ed021ff2c4405f4c3875c.tar.gz |
spy: ensure bytes in write()
-rw-r--r-- | serial/urlhandler/protocol_spy.py | 2 |
1 files changed, 2 insertions, 0 deletions
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 sys import time import serial +from serial.serialutil import to_bytes try: import urlparse @@ -200,6 +201,7 @@ class Serial(serial.Serial): return ''.join([parts.netloc, parts.path]) def write(self, tx): + tx = to_bytes(tx) self.formatter.tx(tx) return super(Serial, self).write(tx) |