diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-23 22:29:43 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-23 22:29:43 (GMT) |
commit | e36f37525ba57546511376d79ddb0f3e983b8f56 (patch) | |
tree | 10a8fb24809e2f707520bb97affe8f5da7011072 /Lib/test/test_posix.py | |
parent | fea0f4d51717fb4b89154e97cfc0084a4965a688 (diff) | |
download | cpython-e36f37525ba57546511376d79ddb0f3e983b8f56.zip cpython-e36f37525ba57546511376d79ddb0f3e983b8f56.tar.gz cpython-e36f37525ba57546511376d79ddb0f3e983b8f56.tar.bz2 |
Issue #12105: test_posix skips test_oscloexec() on Linux < 2.6.23
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 07e6b08..9d9802b 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -310,10 +310,13 @@ class PosixTester(unittest.TestCase): @unittest.skipUnless(hasattr(os, 'O_CLOEXEC'), "needs os.O_CLOEXEC") def test_oscloexec(self): + version = support.linux_version() + if sys.platform == 'linux2' and version < (2, 6, 23): + self.skipTest("Linux kernel 2.6.23 or higher required, " + "not %s.%s.%s" % version) fd = os.open(support.TESTFN, os.O_RDONLY|os.O_CLOEXEC) self.addCleanup(os.close, fd) - self.assertTrue(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC, - 'CLOEXEC flag not set (O_CLOEXEC=0x%x)' % os.O_CLOEXEC) + self.assertTrue(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC) def test_osexlock(self): if hasattr(posix, "O_EXLOCK"): |