]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 13 Apr 2019 16:25:20 +0000 (09:25 -0700)
committerGitHub <noreply@github.com>
Sat, 13 Apr 2019 16:25:20 +0000 (09:25 -0700)
(cherry picked from commit 46544f69bff1c3c4173d461be35993ca0109f622)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Lib/test/test_posix.py

index 11180b7278c9d70a443dbf5b9e56a6ed26dc8f95..55077354589df988e2fb659e4052dd91aa9321c4 100644 (file)
@@ -308,6 +308,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)