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:
Kevin O'Connor 2021-10-31 13:41:50 -04:00
parent fc5353364a
commit 1dee974aea
1 changed files with 3 additions and 3 deletions

View File

@ -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):