summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fcntl.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-08-20 22:39:18 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-08-20 22:39:18 (GMT)
commite67474725b5b13b48ba0007e89314214a6bdca0b (patch)
tree3279b32d93e5c8a8e56e243b3377c5be0e784a98 /Lib/test/test_fcntl.py
parenta9931888edcac8bbaaee813fd8b9cfa02dcb1f4f (diff)
downloadcpython-e67474725b5b13b48ba0007e89314214a6bdca0b.zip
cpython-e67474725b5b13b48ba0007e89314214a6bdca0b.tar.gz
cpython-e67474725b5b13b48ba0007e89314214a6bdca0b.tar.bz2
Issue #12326: refactor usage of sys.platform
* Use str.startswith(tuple): I didn't know this Python feature, Python rocks! * Replace sometimes sys.platform.startswith('linux') with sys.platform == 'linux' * sys.platform doesn't contain the major version on Cygwin on Mac OS X (it's just 'cygwin' and 'darwin')
Diffstat (limited to 'Lib/test/test_fcntl.py')
-rw-r--r--Lib/test/test_fcntl.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 6e425aa..29af99c 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -23,9 +23,8 @@ def get_lockdata():
else:
start_len = "qq"
- if (any(sys.platform.startswith(prefix)
- for prefix in ('netbsd', 'freebsd', 'openbsd', 'bsdos'))
- or sys.platform in ('Darwin1.2', 'darwin')):
+ if (sys.platform.startswith(('netbsd', 'freebsd', 'openbsd', 'bsdos'))
+ or sys.platform == 'darwin'):
if struct.calcsize('l') == 8:
off_t = 'l'
pid_t = 'i'