
The methodology used to generate this CL is documented in https://crbug.com/1098010#c34. An earlier version of this CL, https://crrev.com/c/3879808, was reverted due to an issue that was resolved with https://crrev.com/c/3881211. No-Try: true Bug: 1098010 Change-Id: I91174ff0a9dd8b6dee79e6cba8209b614ce2b712 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3884220 Reviewed-by: Mark Mentovai <mark@chromium.org> Auto-Submit: Avi Drissman <avi@chromium.org> Owners-Override: Avi Drissman <avi@chromium.org> Commit-Queue: Mark Mentovai <mark@chromium.org> Cr-Commit-Position: refs/heads/main@{#1044745}
34 lines
642 B
Python
34 lines
642 B
Python
# Copyright 2013 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
|
|
import sys
|
|
|
|
|
|
def IsWindows():
|
|
return sys.platform in ['win32', 'cygwin']
|
|
|
|
|
|
def IsLinux():
|
|
return sys.platform.startswith(('linux', 'freebsd', 'netbsd', 'openbsd'))
|
|
|
|
|
|
def IsMac():
|
|
return sys.platform == 'darwin'
|
|
|
|
|
|
def host_os():
|
|
"""
|
|
Returns a string representing the host_os of the current system.
|
|
Possible values: 'win', 'mac', 'linux', 'unknown'.
|
|
"""
|
|
if IsWindows():
|
|
return 'win'
|
|
elif IsLinux():
|
|
return 'linux'
|
|
elif IsMac():
|
|
return 'mac'
|
|
else:
|
|
return 'unknown'
|