summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstrap.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bootstrap.py b/bootstrap.py
index 1174686..a4923b4 100644
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -98,9 +98,15 @@ def handle_uncaught_exception(exc_type, exc_value, exc_tb):
ORIGINAL_EXCEPTION_HOOK(exc_type, exc_value, exc_tb)
else:
# a terminal is attached and stderr is not redirected, maybe debug.
+ import io
import traceback
- traceback.print_exception(exc_type, exc_value, exc_tb)
+ tb_output = io.StringIO()
+ traceback.print_tb(exc_tb, None, tb_output)
+ print(tb_output.getvalue(), file=sys.stderr)
+ logger.error(tb_output.getvalue())
+ tb_output.close()
+
if config.config['debug_unhandled_exceptions']:
import pdb