From: Neal Norwitz Date: Tue, 17 Jun 2003 02:51:28 +0000 (+0000) Subject: Convert some repetitive code into a loop X-Git-Tag: v2.3c1~404 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51dead79b5e4514fe6cbc481d72a32a40e1f449c;p=python Convert some repetitive code into a loop --- diff --git a/setup.py b/setup.py index d461880614..99e5d80bab 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