diff --git a/pyunitreport/HtmlTestResult.py b/pyunitreport/HtmlTestResult.py
index 277b0d3..b2b4303 100644
--- a/pyunitreport/HtmlTestResult.py
+++ b/pyunitreport/HtmlTestResult.py
@@ -386,7 +386,15 @@ def _exc_info_to_string(self, err, test):
if exctype is test.failureException:
# Skip assert*() traceback levels
- length = self._count_relevant_tb_levels(tb)
+ #----------------- NEW CHANGED -------------------#
+
+ try:
+ length = self._count_relevant_tb_levels(tb) # inconsistent instance. should override the given method
+
+ except Exception as E:
+ length = self._is_relevant_tb_level(tb)
+ # --------------------- 0 -----------------------#
+
msgLines = traceback.format_exception(exctype, value, tb, length)
else:
msgLines = traceback.format_exception(exctype, value, tb)