mirror of
https://github.com/python/cpython.git
synced 2025-07-22 10:45:22 +00:00
Convert some repetitive code into a loop
This commit is contained in:
parent
938b7a0f63
commit
51dead79b5
1 changed files with 5 additions and 14 deletions
15
setup.py
15
setup.py
|
@ -234,19 +234,10 @@ class PyBuildExt(build_ext):
|
||||||
|
|
||||||
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'
|
|
||||||
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
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
def detect_modules(self):
|
def detect_modules(self):
|
||||||
# Ensure that /usr/local is always used
|
# Ensure that /usr/local is always used
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue