Issue #5622: Fix curses.wrapper to raise correct exception if curses

initialization fails.
This commit is contained in:
Ned Deily 2011-03-09 02:36:51 -08:00
parent c8ab6eeb01
commit d2853180df
2 changed files with 8 additions and 4 deletions

View file

@ -43,7 +43,8 @@ def wrapper(func, *args, **kwds):
return func(stdscr, *args, **kwds)
finally:
# Set everything back to normal
stdscr.keypad(0)
curses.echo()
curses.nocbreak()
curses.endwin()
if 'stdscr' in locals():
stdscr.keypad(0)
curses.echo()
curses.nocbreak()
curses.endwin()