Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ff0235

Browse files
committed
Clean up test_curses.
By using __stdout__ directly, test_curses caused regrtest.py to duplicate the output of some test results.
1 parent c7e994d commit 5ff0235

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

Lib/test/test_curses.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,16 +269,17 @@ def main(stdscr):
269269
finally:
270270
curses.resetty()
271271

272-
if __name__ == '__main__':
273-
curses.wrapper(main)
274-
unit_tests()
275-
else:
272+
def test_main():
276273
# testing setupterm() inside initscr/endwin
277274
# causes terminal breakage
278-
curses.setupterm(fd=sys.__stdout__.fileno())
275+
curses.setupterm(fd=sys.stdout.fileno())
279276
try:
280277
stdscr = curses.initscr()
281278
main(stdscr)
282279
finally:
283280
curses.endwin()
284281
unit_tests()
282+
283+
if __name__ == '__main__':
284+
curses.wrapper(main)
285+
unit_tests()

0 commit comments

Comments
 (0)