]> granicus.if.org Git - python/commitdiff
Fix test_posix if RWF_HIPRI is defined but not preadv2. (GH-13980)
authorBenjamin Peterson <benjamin@python.org>
Tue, 11 Jun 2019 17:15:31 +0000 (10:15 -0700)
committerGitHub <noreply@github.com>
Tue, 11 Jun 2019 17:15:31 +0000 (10:15 -0700)
If preadv2 is not available, preadv will raise NotImplementedError.

Lib/test/test_posix.py

index 5c93d0d507d25274816356c5b19686265e061e46..0f07a8f2e68db8b0f9f27de65f27e7d826be2e78 100644 (file)
@@ -310,6 +310,8 @@ 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 NotImplementedError:
+            self.skipTest("preadv2 not available")
         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