From a2105e1f81f648634c1ed59d018b39b834f01c7c Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 2 May 2019 09:54:08 +1000 Subject: [PATCH] Tools: autotest: correct statustext sending under Python3 --- Tools/autotest/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index 9dadf17748..ec43b0183e 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -1782,7 +1782,9 @@ class AutoTest(ABC): self.progress(fmt % (desc, time)) def send_statustext(self, text): - self.mav.mav.statustext_send(mavutil.mavlink.MAV_SEVERITY_WARNING, bytes(text)) + if sys.version_info.major >= 3 and not isinstance(text, bytes): + text = bytes(text, "ascii") + self.mav.mav.statustext_send(mavutil.mavlink.MAV_SEVERITY_WARNING, text) def get_exception_stacktrace(self, e): if sys.version_info[0] >= 3: