Fix sudo 2 (#18738)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
3672cb160e
commit
09a34b19ed
1 changed files with 3 additions and 2 deletions
|
|
@ -787,11 +787,12 @@ def is_sudo_available() -> bool:
|
|||
Check if the sudo command is available in the environment.
|
||||
|
||||
Returns:
|
||||
bool: True if the sudo command is available, False otherwise.
|
||||
(bool): True if the sudo command is available, False otherwise.
|
||||
"""
|
||||
if WINDOWS:
|
||||
return False
|
||||
subprocess.run("sudo --version", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0
|
||||
cmd = "sudo --version"
|
||||
return subprocess.run(cmd, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0
|
||||
|
||||
|
||||
# Run checks and define constants
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue