mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-11-02 19:36:04 +01:00
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>
This commit is contained in:
@@ -218,9 +218,9 @@ class SerialReader:
|
|||||||
def stats(self, eventtime):
|
def stats(self, eventtime):
|
||||||
if self.serialqueue is None:
|
if self.serialqueue is None:
|
||||||
return ""
|
return ""
|
||||||
self.ffi_lib.serialqueue_get_stats(
|
self.ffi_lib.serialqueue_get_stats(self.serialqueue,
|
||||||
self.serialqueue, self.stats_buf, len(self.stats_buf))
|
self.stats_buf, len(self.stats_buf))
|
||||||
return self.ffi_main.string(self.stats_buf).decode()
|
return str(self.ffi_main.string(self.stats_buf).decode())
|
||||||
def get_reactor(self):
|
def get_reactor(self):
|
||||||
return self.reactor
|
return self.reactor
|
||||||
def get_msgparser(self):
|
def get_msgparser(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user