mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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')
This commit is contained in:
parent
a9931888ed
commit
e67474725b
8 changed files with 12 additions and 20 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue