Mercurial > cpython-lru_cache-weakref
diff Lib/ctypes/util.py @ 72011:b5ccdf7c032a
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')
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Sun, 21 Aug 2011 00:39:18 +0200 |
| parents | c540b18b00b9 |
| children | 096e856a01aa |
line wrap: on
line diff
--- a/Lib/ctypes/util.py Sun Aug 21 00:16:49 2011 +0200 +++ b/Lib/ctypes/util.py Sun Aug 21 00:39:18 2011 +0200 @@ -142,9 +142,7 @@ return None return res.group(1) - if (sys.platform.startswith("freebsd") - or sys.platform.startswith("openbsd") - or sys.platform.startswith("dragonfly")): + if sys.platform.startswith(("freebsd", "openbsd", "dragonfly")): def _num_version(libname): # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ]
