]> granicus.if.org Git - python/commitdiff
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
authorPablo Galindo <Pablogsal@gmail.com>
Sat, 13 Apr 2019 16:06:03 +0000 (17:06 +0100)
committerGitHub <noreply@github.com>
Sat, 13 Apr 2019 16:06:03 +0000 (17:06 +0100)
Lib/test/test_posix.py

index fe21b21b33854418e13642c1cd8f86ea80e235d7..843402930ffc0fc6488a513b96ccb4f9db5aaa6b 100644 (file)
@@ -310,6 +310,14 @@ class PosixTester(unittest.TestCase):
             buf = [bytearray(i) for i in [5, 3, 2]]
             self.assertEqual(posix.preadv(fd, buf, 3, os.RWF_HIPRI), 10)
             self.assertEqual([b't1tt2', b't3t', b'5t'], list(buf))
+        except OSError as inst:
+            # Is possible that the macro RWF_HIPRI was defined at compilation time
+            # but the option is not supported by the kernel or the runtime libc shared
+            # library.
+            if inst.errno in {errno.EINVAL, errno.ENOTSUP}:
+                raise unittest.SkipTest("RWF_HIPRI is not supported by the current system")
+            else:
+                raise
         finally:
             os.close(fd)