summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-08-20 22:39:18 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-08-20 22:39:18 (GMT)
commite67474725b5b13b48ba0007e89314214a6bdca0b (patch)
tree3279b32d93e5c8a8e56e243b3377c5be0e784a98 /setup.py
parenta9931888edcac8bbaaee813fd8b9cfa02dcb1f4f (diff)
downloadcpython-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 'setup.py')
-rw-r--r--setup.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index e127685..542dc49 100644
--- a/setup.py
+++ b/setup.py
@@ -363,9 +363,8 @@ class PyBuildExt(build_ext):
def get_platform(self):
# Get value of sys.platform
- for platform in ['cygwin', 'darwin', 'osf1']:
- if sys.platform.startswith(platform):
- return platform
+ if sys.platform.startswith('osf1'):
+ return 'osf1'
return sys.platform
def add_multiarch_paths(self):