Workaroung python bug in traceback.format_exc()

The function raises an AttributeError if there is no current exception.
https://bugs.python.org/issue23003
This commit is contained in:
Dmitry Kuzmenko 2018-02-14 16:16:57 +03:00 committed by rallytime
parent 554400e067
commit bf0b962dc0
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -43,7 +43,12 @@ def _handle_interrupt(exc, original_exc, hardfail=False, trace=''):
def _handle_signals(client, signum, sigframe):
trace = traceback.format_exc()
try:
# This raises AttributeError on Python 3.4 and 3.5 if there is no current exception.
# Ref: https://bugs.python.org/issue23003
trace = traceback.format_exc()
except AttributeError:
trace = ''
try:
hardcrash = client.options.hard_crash
except (AttributeError, KeyError):