Mercurial > cpython-lru_cache-weakref
diff Lib/distutils/command/build_ext.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 | 3e26c9033306 |
| children | f7163afecb97 |
line wrap: on
line diff
--- a/Lib/distutils/command/build_ext.py Sun Aug 21 00:16:49 2011 +0200 +++ b/Lib/distutils/command/build_ext.py Sun Aug 21 00:39:18 2011 +0200 @@ -240,8 +240,7 @@ # for extensions under Linux or Solaris with a shared Python library, # Python's library directory must be appended to library_dirs sysconfig.get_config_var('Py_ENABLE_SHARED') - if ((sys.platform.startswith('linux') or sys.platform.startswith('gnu') - or sys.platform.startswith('sunos')) + if (sys.platform.startswith(('linux', 'gnu', 'sunos')) and sysconfig.get_config_var('Py_ENABLE_SHARED')): if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): # building third party extensions
