]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Skip early if stdin and stdout are not ttys
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 6 Nov 2011 02:03:18 +0000 (03:03 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 6 Nov 2011 02:03:18 +0000 (03:03 +0100)
Lib/test/test_builtin.py

index 244e55ffb53ab4d0853d1e51d7d0b3e698018f6d..55fb63ae3f5b344cea031a86fb3b1786049e28fa 100644 (file)
@@ -996,6 +996,8 @@ class BuiltinTest(unittest.TestCase):
 
     @unittest.skipUnless(pty, "the pty and signal modules must be available")
     def check_input_tty(self, prompt, terminal_input, stdio_encoding=None):
+        if not sys.stdin.isatty() or not sys.stdout.isatty():
+            self.skipTest("stdin and stdout must be ttys")
         r, w = os.pipe()
         try:
             pid, fd = pty.fork()