Show More
@@ -863,13 +863,10 b' class VerboseTB(TBTools):' | |||
|
863 | 863 | direct_cause = "\nThe above exception was the direct cause of the following exception:\n" |
|
864 | 864 | exception_during_handling = "\nDuring handling of the above exception, another exception occurred:\n" |
|
865 | 865 | |
|
866 | colors = self.Colors # just a shorthand + quicker name lookup | |
|
867 | colorsnormal = colors.Normal # used a lot | |
|
868 | head = '%s%s%s' % (colors.topline, '-' * 75, colorsnormal) | |
|
869 | 866 | if cause: |
|
870 |
message = [[ |
|
|
867 | message = [[direct_cause]] | |
|
871 | 868 | else: |
|
872 |
message = [[ |
|
|
869 | message = [[exception_during_handling]] | |
|
873 | 870 | return message |
|
874 | 871 | |
|
875 | 872 | def prepare_header(self, etype, long_version=False): |
@@ -888,9 +885,8 b' class VerboseTB(TBTools):' | |||
|
888 | 885 | "\ncalls leading up to the error, with the most recent (innermost) call last." |
|
889 | 886 | else: |
|
890 | 887 | # Simplified header |
|
891 | head = '%s%s%s\n%s%s' % (colors.topline, '-' * 75, colorsnormal, exc, | |
|
892 | 'Traceback (most recent call last)'. \ | |
|
893 | rjust(75 - len(str(etype))) ) | |
|
888 | head = '%s%s' % (exc, 'Traceback (most recent call last)'. \ | |
|
889 | rjust(75 - len(str(etype))) ) | |
|
894 | 890 | |
|
895 | 891 | return head |
|
896 | 892 | |
@@ -990,11 +986,14 b' class VerboseTB(TBTools):' | |||
|
990 | 986 | formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context, |
|
991 | 987 | tb_offset) |
|
992 | 988 | |
|
989 | colors = self.Colors # just a shorthand + quicker name lookup | |
|
990 | colorsnormal = colors.Normal # used a lot | |
|
991 | head = '%s%s%s' % (colors.topline, '-' * 75, colorsnormal) | |
|
992 | structured_traceback_parts = [head] | |
|
993 | 993 | if py3compat.PY3: |
|
994 | 994 | chained_exceptions_tb_offset = 0 |
|
995 | 995 | lines_of_context = 3 |
|
996 | 996 | formatted_exceptions = formatted_exception |
|
997 | structured_traceback_parts = [] | |
|
998 | 997 | exception = self.get_exception_from_context(evalue) |
|
999 | 998 | if exception: |
|
1000 | 999 | formatted_exceptions += self.prepare_chained_exception_message(evalue.__cause__) |
@@ -1016,7 +1015,7 b' class VerboseTB(TBTools):' | |||
|
1016 | 1015 | for formatted_exception in reversed(formatted_exceptions): |
|
1017 | 1016 | structured_traceback_parts += formatted_exception |
|
1018 | 1017 | else: |
|
1019 | structured_traceback_parts = formatted_exception[0] | |
|
1018 | structured_traceback_parts += formatted_exception[0] | |
|
1020 | 1019 | |
|
1021 | 1020 | return structured_traceback_parts |
|
1022 | 1021 |
General Comments 0
You need to be logged in to leave comments.
Login now