diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-08-20 22:39:18 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-08-20 22:39:18 (GMT) |
commit | e67474725b5b13b48ba0007e89314214a6bdca0b (patch) | |
tree | 3279b32d93e5c8a8e56e243b3377c5be0e784a98 /Lib/distutils/command/build_ext.py | |
parent | a9931888edcac8bbaaee813fd8b9cfa02dcb1f4f (diff) | |
download | cpython-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/distutils/command/build_ext.py')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 8d843d6..8baf538 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -240,8 +240,7 @@ class build_ext(Command): # 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 |