[Python-checkins] cpython: Issue #12105: test_posix skips test_oscloexec() on Linux < 2.6.23

victor.stinner python-checkins at python.org
Tue May 24 00:29:47 CEST 2011


http://hg.python.org/cpython/rev/9a16fa0c9548
changeset:   70325:9a16fa0c9548
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Tue May 24 00:29:43 2011 +0200
summary:
  Issue #12105: test_posix skips test_oscloexec() on Linux < 2.6.23

files:
  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
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -310,10 +310,13 @@
 
     @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"):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list