diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2003-03-20 04:33:16 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2003-03-20 04:33:16 (GMT) |
commit | 26f42f68211d320307a771c075bcabe18f7c62b9 (patch) | |
tree | 1c1b86813d9a99c0651659dfb2f55f1e38f74f58 /Lib/test/test_ioctl.py | |
parent | fe94e97e48285c9917921aff231dae7b650141d7 (diff) | |
download | cpython-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).
Diffstat (limited to 'Lib/test/test_ioctl.py')
-rw-r--r-- | Lib/test/test_ioctl.py | 6 |
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() |