From d146ef6507e8400699291c5c9b84672804d3f0eb Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 10 Oct 2019 05:26:11 +0000 Subject: [PATCH] [FIX] hw_blackbox_be: python3 support Was comparing b'0x02' and '0x02' closes odoo/odoo#39214 X-original-commit: 838cb0e8c10de4229c8b04592aefa1808771bbb3 Signed-off-by: Martin Trigaux (mat) --- addons/hw_blackbox_be/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hw_blackbox_be/controllers/main.py b/addons/hw_blackbox_be/controllers/main.py index 34dc06369e5..5ec49ad61d0 100644 --- a/addons/hw_blackbox_be/controllers/main.py +++ b/addons/hw_blackbox_be/controllers/main.py @@ -139,7 +139,7 @@ class Blackbox(Thread): etx = ser.read(1) bcc = ser.read(1) - if stx == chr(0x02) and etx == chr(0x03) and bcc and self._lrc(response) == ord(bcc): + if stx == chr(0x02).encode() and etx == chr(0x03).encode() and bcc and self._lrc(response.decode()) == ord(bcc): got_response = True ser.write(chr(0x06).encode()) else: