From 26f42f68211d320307a771c075bcabe18f7c62b9 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 20 Mar 2003 04:33:16 +0000 Subject: Skip the ioctl test if we can't open /dev/tty. This happens on Solaris (and probably other Unixes) when run without a terminal (eg, from cron or at). --- Lib/test/test_ioctl.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Lib/test/test_ioctl.py') diff --git a/Lib/test/test_ioctl.py b/Lib/test/test_ioctl.py index a6a59c5a4e1..959d16e5924 100644 --- a/Lib/test/test_ioctl.py +++ b/Lib/test/test_ioctl.py @@ -8,6 +8,12 @@ except ImportError: if not hasattr(termios,'TIOCGPGRP'): raise TestSkipped("termios module doesn't have TIOCGPGRP") +try: + tty = open("/dev/tty", "r") + tty.close() +except IOError: + raise TestSkipped("Unable to open /dev/tty") + class IoctlTests(unittest.TestCase): def test_ioctl(self): pgrp = os.getpgrp() -- cgit v1.2.3