summaryrefslogtreecommitdiff
path: root/src/common.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-03-18 19:43:44 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-03-18 19:43:44 +0000
commitfc82ad6b3d3aa917fd70edfb73278356cce41ad4 (patch)
treee6c6b2314e86f7952981b94236b8cac7c5101b90 /src/common.py
parent5d7bb0fd6751e28320dad715e98bfe8112ee71f6 (diff)
downloadpoezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.tar.gz
poezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.tar.bz2
poezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.tar.xz
poezio-fc82ad6b3d3aa917fd70edfb73278356cce41ad4.zip
fixed #1186
Diffstat (limited to 'src/common.py')
-rw-r--r--src/common.py13
1 files changed, 13 insertions, 0 deletions
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):