summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-06-17 02:51:28 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-06-17 02:51:28 (GMT)
commit51dead79b5e4514fe6cbc481d72a32a40e1f449c (patch)
tree6a6b8d511fd36432b66a848cc361a5c3d96147c6 /setup.py
parent938b7a0f63d2485bc5a45555f432131a96b4e9a8 (diff)
downloadcpython-51dead79b5e4514fe6cbc481d72a32a40e1f449c.zip
cpython-51dead79b5e4514fe6cbc481d72a32a40e1f449c.tar.gz
cpython-51dead79b5e4514fe6cbc481d72a32a40e1f449c.tar.bz2
Convert some repetitive code into a loop
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/setup.py b/setup.py
index d461880..99e5d80 100644
--- a/setup.py
+++ b/setup.py
@@ -232,21 +232,12 @@ class PyBuildExt(build_ext):
'failed with %s: %s' % (ext.name, exc_type, why),
level=3)
- def get_platform (self):
+ def get_platform(self):
# Get value of sys.platform
- platform = sys.platform
- if platform[:6] =='cygwin':
- platform = 'cygwin'
- elif platform[:4] =='beos':
- platform = 'beos'
- elif platform[:6] == 'darwin':
- platform = 'darwin'
- elif platform[:6] == 'atheos':
- platform = 'atheos'
- elif platform[:4] == 'osf1':
- platform = 'osf1'
-
- return platform
+ for platform in ['cygwin', 'beos', 'darwin', 'atheos', 'osf1']:
+ if sys.platform.startswith(platform):
+ return platform
+ return sys.platform
def detect_modules(self):
# Ensure that /usr/local is always used