summaryrefslogtreecommitdiff
path: root/src/poezio.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-19 23:55:20 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-19 23:55:20 +0000
commit0cd619660c83a238bd0192ac5707e1ab591d7408 (patch)
tree5a7311a1f6997de4bef22cf13c15ba38b1c6eebf /src/poezio.py
parente656e5924bef38d5e69fffca6e1d46c7bed69139 (diff)
downloadpoezio-0cd619660c83a238bd0192ac5707e1ab591d7408.tar.gz
poezio-0cd619660c83a238bd0192ac5707e1ab591d7408.tar.bz2
poezio-0cd619660c83a238bd0192ac5707e1ab591d7408.tar.xz
poezio-0cd619660c83a238bd0192ac5707e1ab591d7408.zip
fixed #1587
Diffstat (limited to 'src/poezio.py')
-rw-r--r--src/poezio.py32
1 files changed, 2 insertions, 30 deletions
diff --git a/src/poezio.py b/src/poezio.py
index 501ccfd2..6a5dc435 100644
--- a/src/poezio.py
+++ b/src/poezio.py
@@ -20,39 +20,11 @@
"""
Starting point of poezio. Launches both the Connection and Gui
"""
+
import sys
import traceback
import curses
-
-class MyStdErr(object):
- def __init__(self, fd):
- """
- Change sys.stderr to something like /dev/null
- to disable any printout on the screen that would
- mess everything
- """
- self.old_stderr = sys.stderr
- sys.stderr = fd
- def restaure(self):
- """
- Restaure the good ol' sys.stderr, because we need
- it in order to print the tracebacks
- """
- sys.stderr = self.old_stderr
-
-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
- """
- global my_stderr
- my_stderr.restaure()
- curses.endwin()
- curses.echo()
- traceback.print_exception(type_, value, trace, None, sys.stderr)
- sys.exit(2)
+from common import MyStdErr, exception_handler
sys.excepthook = exception_handler