Skip to content

Commit 8cb1805

Browse files
committed
wrap str method in try/except to see why its fialing
1 parent 600344d commit 8cb1805

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/test_future/test_utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,14 @@ def test_chained_exceptions_stacktrace(self):
379379
class CustomException(Exception):
380380
if PY2:
381381
def __str__(self):
382-
out = Exception.__str__(self)
383-
if hasattr(self, '__cause__') and self.__cause__ and hasattr(self.__cause__, '__traceback__') and self.__cause__.__traceback__:
384-
out += '\n\nThe above exception was the direct cause of the following exception:\n\n'
385-
out += ''.join(traceback.format_tb(self.__cause__.__traceback__) + ['{}: {}'.format(self.__cause__.__class__.__name__, self.__cause__.message)])
386-
return out
382+
try:
383+
out = Exception.__str__(self)
384+
if hasattr(self, '__cause__') and self.__cause__ and hasattr(self.__cause__, '__traceback__') and self.__cause__.__traceback__:
385+
out += '\n\nThe above exception was the direct cause of the following exception:\n\n'
386+
out += ''.join(traceback.format_tb(self.__cause__.__traceback__) + ['{}: {}'.format(self.__cause__.__class__.__name__, self.__cause__)])
387+
return out
388+
except Exception as e:
389+
print(e)
387390
else:
388391
pass
389392

0 commit comments

Comments
 (0)