summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-03 18:28:11 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-09-03 18:28:11 +0000
commitf4abe3915e97f0991232bee08a1e4a87b65515b1 (patch)
tree44ae67642a4223f2db934c410409bf4963d51435
parent17eb99eea718191b619277754bf15e6a7554d916 (diff)
downloadpoezio-f4abe3915e97f0991232bee08a1e4a87b65515b1.tar.gz
poezio-f4abe3915e97f0991232bee08a1e4a87b65515b1.tar.bz2
poezio-f4abe3915e97f0991232bee08a1e4a87b65515b1.tar.xz
poezio-f4abe3915e97f0991232bee08a1e4a87b65515b1.zip
fixed #1761
-rw-r--r--src/poezio.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 27bc359a..23978055 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -20,7 +20,7 @@
Starting point of poezio. Launches both the Connection and Gui
"""
-import threading
+import curses
import sys
import traceback
@@ -41,23 +41,24 @@ class MyStdErr(object):
sys.stderr.close()
sys.stderr = self.old_stderr
-# my_stderr = MyStdErr(open('/dev/null', 'a'))
+my_stderr = MyStdErr(open('/dev/null', 'a'))
-# def exception_handler(type_, value, trace):
-# """
-# on any traceback: exit ncurses and print the traceback
-# then exit the program
-# """
-# my_stderr.restaure()
-# curses.endwin()
-# curses.echo()
-# traceback.print_exception(type_, value, trace, None, sys.stderr)
-# import os # used to quit the program even from a thread
-# os.abort()
+def exception_handler(type_, value, trace):
+ """
+ on any traceback: exit ncurses and print the traceback
+ then exit the program
+ """
+ my_stderr.restaure()
+ curses.endwin()
+ curses.echo()
+ traceback.print_exception(type_, value, trace, None, sys.stderr)
+ import os # used to quit the program even from a thread
+ os.abort()
-# sys.excepthook = exception_handler
+sys.excepthook = exception_handler
import signal
+import os
from connection import Connection
from config import config
@@ -77,4 +78,5 @@ def main():
gui.main_loop() # Refresh the screen, wait for user events etc
if __name__ == '__main__':
+ os.environ['TERM'] = 'xterm-256color' # FIXME
main()