Commit 7d000990 authored by Georg Brandl's avatar Georg Brandl

Move the check for openpty to the beginning.

parent 59ba4299
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
import os, unittest import os, unittest
from test.test_support import run_unittest, TestSkipped from test.test_support import run_unittest, TestSkipped
if not hasattr(os, "openpty"):
raise TestSkipped, "No openpty() available."
class OpenptyTest(unittest.TestCase): class OpenptyTest(unittest.TestCase):
def test(self): def test(self):
try: master, slave = os.openpty()
master, slave = os.openpty()
except AttributeError:
raise TestSkipped, "No openpty() available."
if not os.isatty(slave): if not os.isatty(slave):
self.fail("Slave-end of pty is not a terminal.") self.fail("Slave-end of pty is not a terminal.")
......
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