commit | 165388c086df24164b6934064ba123afa5c5ddc3 | [log] [tgz] |
---|---|---|
author | Chris Liechti <cliechti@gmx.net> | Sat Aug 22 00:24:08 2015 +0200 |
committer | Chris Liechti <cliechti@gmx.net> | Sat Aug 22 00:24:08 2015 +0200 |
tree | a406ea3a6edc8db0dbd3e848987c9d5514044a2f | |
parent | 686117dc424c302f430119469f36ed48f032c545 [diff] [blame] |
spy: bytes/Unicode handling (Python 3 compatibility)
diff --git a/serial/urlhandler/protocol_spy.py b/serial/urlhandler/protocol_spy.py index dae44a8..cb89eb5 100644 --- a/serial/urlhandler/protocol_spy.py +++ b/serial/urlhandler/protocol_spy.py
@@ -40,7 +40,7 @@ """ n = 0 for b in serial.iterbytes(data): - yield ('{:02X} '.format(ord(b)), b if b' ' <= b < b'\x7f' else b'.') + yield ('{:02X} '.format(ord(b)), b.decode('ascii') if b' ' <= b < b'\x7f' else '.') n += 1 if n == 8: yield (' ', ' ')