mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 15:53:56 -04:00
autotest: correct exception handling for Python 3.10
This commit is contained in:
parent
7e7da560d5
commit
f2fe55b5da
@ -6558,10 +6558,12 @@ Also, ignores heartbeats not from our target system'''
|
||||
def get_exception_stacktrace(self, e):
|
||||
if sys.version_info[0] >= 3:
|
||||
ret = "%s\n" % e
|
||||
ret += ''.join(traceback.format_exception(etype=type(e),
|
||||
value=e,
|
||||
ret += ''.join(traceback.format_exception(type(e),
|
||||
e,
|
||||
tb=e.__traceback__))
|
||||
return ret
|
||||
|
||||
# Python2:
|
||||
return traceback.format_exc(e)
|
||||
|
||||
def bin_logs(self):
|
||||
|
@ -527,10 +527,12 @@ is bob we will attempt to checkout bob-AVR'''
|
||||
def get_exception_stacktrace(self, e):
|
||||
if sys.version_info[0] >= 3:
|
||||
ret = "%s\n" % e
|
||||
ret += ''.join(traceback.format_exception(etype=type(e),
|
||||
value=e,
|
||||
ret += ''.join(traceback.format_exception(type(e),
|
||||
e,
|
||||
tb=e.__traceback__))
|
||||
return ret
|
||||
|
||||
# Python2:
|
||||
return traceback.format_exc(e)
|
||||
|
||||
def print_exception_caught(self, e, send_statustext=True):
|
||||
|
Loading…
Reference in New Issue
Block a user