From f4abe3915e97f0991232bee08a1e4a87b65515b1 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Fri, 3 Sep 2010 18:28:11 +0000 Subject: fixed #1761 --- src/poezio.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/poezio.py') 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() -- cgit v1.2.3