Skip to content

Commit

Permalink
Use startswith() to check the system platform again 'linux'
Browse files Browse the repository at this point in the history
Some platforms like Alpine Linux actually return 'linux2' here, i.e. they
include the major Linux version as a suffix, also see [1].

[1] https://docs.python.org/dev/library/sys.html#sys.platform

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Nov 6, 2018
1 parent 86722b3 commit 46d3573
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion etc/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def unsupported(platform):
arch = '32'

sys_platform = str(sys.platform).lower()
if 'linux' in sys_platform:
if sys_platform.startswith('linux'):
os = 'linux'
elif 'win32' in sys_platform:
os = 'win'
Expand Down
2 changes: 1 addition & 1 deletion etc/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# platform-specific file base names
sys_platform = str(sys.platform).lower()
on_win = False
if 'linux' in sys_platform:
if sys_platform.startswith('linux'):
platform_names = ('posix', 'linux',)
elif 'win32' in sys_platform:
platform_names = ('win',)
Expand Down
2 changes: 1 addition & 1 deletion src/commoncode/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def os_arch():
arch = '32'

sys_platform = str(sys.platform).lower()
if 'linux' in sys_platform:
if sys_platform.startswith('linux'):
os = 'linux'
elif 'win32' in sys_platform:
os = 'win'
Expand Down

0 comments on commit 46d3573

Please sign in to comment.