summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-03-20 04:33:16 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-03-20 04:33:16 (GMT)
commit26f42f68211d320307a771c075bcabe18f7c62b9 (patch)
tree1c1b86813d9a99c0651659dfb2f55f1e38f74f58
parentfe94e97e48285c9917921aff231dae7b650141d7 (diff)
downloadcpython-26f42f68211d320307a771c075bcabe18f7c62b9.zip
cpython-26f42f68211d320307a771c075bcabe18f7c62b9.tar.gz
cpython-26f42f68211d320307a771c075bcabe18f7c62b9.tar.bz2
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).
-rw-r--r--Lib/test/test_ioctl.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_ioctl.py b/Lib/test/test_ioctl.py
index a6a59c5..959d16e 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()