From aa5e3cea7aeabd4d1c2ad61a60b538c0f842799d Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Mon, 25 Feb 2008 16:29:19 +0000 Subject: [PATCH] Move .setupterm() output so that we don't try to call endwin() if it fails --- Lib/test/test_curses.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index b236f35b189..d1b80f88dc2 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -269,13 +269,12 @@ if __name__ == '__main__': curses.wrapper(main) unit_tests() else: + # testing setupterm() inside initscr/endwin + # causes terminal breakage + curses.setupterm(fd=sys.__stdout__.fileno()) try: - # testing setupterm() inside initscr/endwin - # causes terminal breakage - curses.setupterm(fd=sys.__stdout__.fileno()) stdscr = curses.initscr() main(stdscr) finally: curses.endwin() - unit_tests()