diff --git a/ultralytics/utils/checks.py b/ultralytics/utils/checks.py index bba75298..984b7e46 100644 --- a/ultralytics/utils/checks.py +++ b/ultralytics/utils/checks.py @@ -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