Issue #12326: don't test the major version of sys.platform
Use startswith, instead of ==, when testing sys.platform to support
new platforms like Linux 3 or OpenBSD 5.
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 6c64b82..6e425aa 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -23,12 +23,9 @@
else:
start_len = "qq"
- if sys.platform in ('netbsd1', 'netbsd2', 'netbsd3',
- 'Darwin1.2', 'darwin',
- 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
- 'freebsd6', 'freebsd7', 'freebsd8',
- 'bsdos2', 'bsdos3', 'bsdos4',
- 'openbsd', 'openbsd2', 'openbsd3', 'openbsd4'):
+ if (any(sys.platform.startswith(prefix)
+ for prefix in ('netbsd', 'freebsd', 'openbsd', 'bsdos'))
+ or sys.platform in ('Darwin1.2', 'darwin')):
if struct.calcsize('l') == 8:
off_t = 'l'
pid_t = 'i'