Kaydet (Commit) 26f42f68 authored tarafından Neal Norwitz's avatar Neal Norwitz

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).
üst fe94e97e
...@@ -8,6 +8,12 @@ except ImportError: ...@@ -8,6 +8,12 @@ except ImportError:
if not hasattr(termios,'TIOCGPGRP'): if not hasattr(termios,'TIOCGPGRP'):
raise TestSkipped("termios module doesn't have 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): class IoctlTests(unittest.TestCase):
def test_ioctl(self): def test_ioctl(self):
pgrp = os.getpgrp() pgrp = os.getpgrp()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment