Kaydet (Commit) aa5e3cea authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

Move .setupterm() output so that we don't try to call endwin() if it fails

üst c6b52009
...@@ -269,13 +269,12 @@ if __name__ == '__main__': ...@@ -269,13 +269,12 @@ if __name__ == '__main__':
curses.wrapper(main) curses.wrapper(main)
unit_tests() unit_tests()
else: else:
# testing setupterm() inside initscr/endwin
# causes terminal breakage
curses.setupterm(fd=sys.__stdout__.fileno())
try: try:
# testing setupterm() inside initscr/endwin
# causes terminal breakage
curses.setupterm(fd=sys.__stdout__.fileno())
stdscr = curses.initscr() stdscr = curses.initscr()
main(stdscr) main(stdscr)
finally: finally:
curses.endwin() curses.endwin()
unit_tests() unit_tests()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment