cpython: 9a16fa0c9548 (original) (raw)
Mercurial > cpython
changeset 70325:9a16fa0c9548
Issue #12105: test_posix skips test_oscloexec() on Linux < 2.6.23 [#12105]
Victor Stinner victor.stinner@haypocalc.com | |
---|---|
date | Tue, 24 May 2011 00:29:43 +0200 |
parents | d585a6d548a3 |
children | 1b13707708b1 |
files | Lib/test/test_posix.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_posix.py 7 |
line wrap: on
line diff
--- 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()[](#l1.7)
if sys.platform == 'linux2' and version < (2, 6, 23):[](#l1.8)
self.skipTest("Linux kernel 2.6.23 or higher required, "[](#l1.9)
"not %s.%s.%s" % version)[](#l1.10) fd = os.open(support.TESTFN, os.O_RDONLY|os.O_CLOEXEC)[](#l1.11) self.addCleanup(os.close, fd)[](#l1.12)
self.assertTrue(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,[](#l1.13)
'CLOEXEC flag not set (O_CLOEXEC=0x%x)' % os.O_CLOEXEC)[](#l1.14)
self.assertTrue(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC)[](#l1.15)