mirror of https://github.com/python/cpython
Convert some repetitive code into a loop
This commit is contained in:
parent
938b7a0f63
commit
51dead79b5
19
setup.py
19
setup.py
|
@ -232,21 +232,12 @@ class PyBuildExt(build_ext):
|
||||||
'failed with %s: %s' % (ext.name, exc_type, why),
|
'failed with %s: %s' % (ext.name, exc_type, why),
|
||||||
level=3)
|
level=3)
|
||||||
|
|
||||||
def get_platform (self):
|
def get_platform(self):
|
||||||
# Get value of sys.platform
|
# Get value of sys.platform
|
||||||
platform = sys.platform
|
for platform in ['cygwin', 'beos', 'darwin', 'atheos', 'osf1']:
|
||||||
if platform[:6] =='cygwin':
|
if sys.platform.startswith(platform):
|
||||||
platform = 'cygwin'
|
return platform
|
||||||
elif platform[:4] =='beos':
|
return sys.platform
|
||||||
platform = 'beos'
|
|
||||||
elif platform[:6] == 'darwin':
|
|
||||||
platform = 'darwin'
|
|
||||||
elif platform[:6] == 'atheos':
|
|
||||||
platform = 'atheos'
|
|
||||||
elif platform[:4] == 'osf1':
|
|
||||||
platform = 'osf1'
|
|
||||||
|
|
||||||
return platform
|
|
||||||
|
|
||||||
def detect_modules(self):
|
def detect_modules(self):
|
||||||
# Ensure that /usr/local is always used
|
# Ensure that /usr/local is always used
|
||||||
|
|
Loading…
Reference in New Issue