From 2c1d0270c6045e2d0b94df0b831911a2bfd17fbc Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Mon, 13 Jul 2009 20:42:34 -0400 Subject: [PATCH] fix traceback output --HG-- branch : pmacs2 --- application.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application.py b/application.py index d1b5cb1..678365f 100755 --- a/application.py +++ b/application.py @@ -1185,10 +1185,12 @@ if __name__ == "__main__": curses.wrapper(run_app, buffers, **d) err = 0 except: + # restore terminal state before printing an error + termios.tcsetattr(sys.stdin, termios.TCSANOW, attr) traceback.print_exc() err = 1 - # restore terminal state + # restore terminal state before exiting termios.tcsetattr(sys.stdin, termios.TCSANOW, attr) ispell.free() sys.exit(err)