Merge "Fix potential error for sys.platform"

This commit is contained in:
Dan Willemsen
2022-06-15 20:02:04 +00:00
committed by Gerrit Code Review

View File

@@ -72,9 +72,9 @@ ELF = collections.namedtuple(
def _get_os_name(): def _get_os_name():
"""Get the host OS name.""" """Get the host OS name."""
if sys.platform == 'linux2': if sys.platform.startswith('linux'):
return 'linux' return 'linux'
if sys.platform == 'darwin': if sys.platform.startswith('darwin'):
return 'darwin' return 'darwin'
raise ValueError(sys.platform + ' is not supported') raise ValueError(sys.platform + ' is not supported')