From fc82ad6b3d3aa917fd70edfb73278356cce41ad4 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Thu, 18 Mar 2010 19:43:44 +0000 Subject: fixed #1186 --- src/common.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/common.py') diff --git a/src/common.py b/src/common.py index e4026efb..421aada2 100644 --- a/src/common.py +++ b/src/common.py @@ -37,6 +37,19 @@ import os import mimetypes import hashlib import subprocess +import curses +import traceback +import sys + +def exception_handler(type_, value, trace): + """ + on any traceback: exit ncurses and print the traceback + then exit the program + """ + curses.echo() + curses.endwin() + traceback.print_exception(type_, value, trace, None, sys.stderr) + sys.exit(2) def get_base64_from_file(path): if not os.path.isfile(path): -- cgit v1.2.3