summaryrefslogtreecommitdiff
path: root/Lib/distutils/command
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-08-21 00:39:18 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-08-21 00:39:18 +0200
commit7f57d3c260ab6d84b697c3e721b73f7b19705d42 (patch)
treedf56a514f6263604a40e46f513f6c1096238435f /Lib/distutils/command
parenteffb4ee8292ba8e9cc48556f4f5ab34605882a46 (diff)
downloadcpython-7f57d3c260ab6d84b697c3e721b73f7b19705d42.tar.gz
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')
-rw-r--r--Lib/distutils/command/build_ext.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index 8d843d689f..8baf538f2a 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