diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-10-31 13:41:50 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-10-31 13:52:31 -0400 |
commit | 1dee974aea5c9837cf69070065a020c91b60e134 (patch) | |
tree | 01932ef21bb9ca63f4e81a141dffa56333bb09c8 /klippy | |
parent | fc5353364a3d7ea48fb089926e968fa52177a173 (diff) | |
download | kutter-1dee974aea5c9837cf69070065a020c91b60e134.tar.gz kutter-1dee974aea5c9837cf69070065a020c91b60e134.tar.xz kutter-1dee974aea5c9837cf69070065a020c91b60e134.zip |
serialhdl: Use regular str() type for stats on Python2
Avoid using unicode() types on Python2 as it can lead to subtle
errors.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy')
-rw-r--r-- | klippy/serialhdl.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py index b4102c6a..b916ab20 100644 --- a/klippy/serialhdl.py +++ b/klippy/serialhdl.py @@ -218,9 +218,9 @@ class SerialReader: def stats(self, eventtime): if self.serialqueue is None: return "" - self.ffi_lib.serialqueue_get_stats( - self.serialqueue, self.stats_buf, len(self.stats_buf)) - return self.ffi_main.string(self.stats_buf).decode() + self.ffi_lib.serialqueue_get_stats(self.serialqueue, + self.stats_buf, len(self.stats_buf)) + return str(self.ffi_main.string(self.stats_buf).decode()) def get_reactor(self): return self.reactor def get_msgparser(self): |