From: Georg Brandl Date: Sun, 29 Oct 2006 21:54:18 +0000 (+0000) Subject: Move the check for openpty to the beginning. X-Git-Tag: v2.6a1~2476 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d000990214fb6e73669b6127141a95171bc8ca0;p=python Move the check for openpty to the beginning. --- diff --git a/Lib/test/test_openpty.py b/Lib/test/test_openpty.py index f770af617b..6471f58ce5 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.")