Browse Source

Tools: autotest: correct statustext sending under Python3

master
Peter Barker 6 years ago committed by Peter Barker
parent
commit
a2105e1f81
  1. 4
      Tools/autotest/common.py

4
Tools/autotest/common.py

@ -1782,7 +1782,9 @@ class AutoTest(ABC): @@ -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:

Loading…
Cancel
Save