diff options
author | Georg Brandl <georg@python.org> | 2006-10-29 21:54:18 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-10-29 21:54:18 (GMT) |
commit | 7d000990214fb6e73669b6127141a95171bc8ca0 (patch) | |
tree | 26baafd6c743528bc291dea313e4d95d597a823a /Lib | |
parent | 59ba4299d04948e2bc8e929b39859f58b25e047c (diff) | |
download | cpython-7d000990214fb6e73669b6127141a95171bc8ca0.zip cpython-7d000990214fb6e73669b6127141a95171bc8ca0.tar.gz cpython-7d000990214fb6e73669b6127141a95171bc8ca0.tar.bz2 |
Move the check for openpty to the beginning.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_openpty.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_openpty.py b/Lib/test/test_openpty.py index f770af6..6471f58 100644 --- a/Lib/test/test_openpty.py +++ b/Lib/test/test_openpty.py @@ -3,13 +3,13 @@ import os, unittest from test.test_support import run_unittest, TestSkipped +if not hasattr(os, "openpty"): + raise TestSkipped, "No openpty() available." + + class OpenptyTest(unittest.TestCase): def test(self): - try: - master, slave = os.openpty() - except AttributeError: - raise TestSkipped, "No openpty() available." - + master, slave = os.openpty() if not os.isatty(slave): self.fail("Slave-end of pty is not a terminal.") |