From 02b0b51dcfd4cea16449bbebe6569f516e33ccfa Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 7 May 2019 08:45:14 +0200 Subject: [PATCH] format_value: catch BaseException Ref: https://github.com/Qix-/better-exceptions/issues/85#issuecomment-489930136 --- better_exceptions/formatter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/better_exceptions/formatter.py b/better_exceptions/formatter.py index e57f578..b8281d1 100644 --- a/better_exceptions/formatter.py +++ b/better_exceptions/formatter.py @@ -115,7 +115,9 @@ class ExceptionFormatter(object): def format_value(self, v): try: v = repr(v) - except Exception: + except KeyboardInterrupt: + raise + except BaseException: v = u'' % type(v).__name__ max_length = self._max_length