[3.8] [3.9] bpo-42789: Don't skip curses tests on non-tty. (GH-24009) (GH-24076) by serhiy-storchaka · Pull Request #24078 · python/cpython

@serhiy-storchaka

…24009) (pythonGH-24076)

If __stdout__ is not attached to terminal, try to use __stderr__
if it is attached to terminal, or open the terminal device, or
use regular file as terminal, but some functions will be untested
in the latter case.
(cherry picked from commit 607501a).
(cherry picked from commit 0303008)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>