From ada5f7a65fa06ac844bc3e3953c0a4925f85daa5 Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Sat, 26 Aug 2023 18:51:04 +0200 Subject: [PATCH] Handle possible missing binary --- backend/localplatform.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/localplatform.py b/backend/localplatform.py index 6989fcb96..172341186 100644 --- a/backend/localplatform.py +++ b/backend/localplatform.py @@ -45,7 +45,8 @@ def get_log_level() -> int: def get_selinux() -> bool: if ON_LINUX: from subprocess import check_output - if (check_output("getenforce").decode("ascii").strip("\n") == "Enforcing"): + import shutil + if (shutil.which(getenforce) is not None and (check_output("getenforce").decode("ascii").strip("\n") is "Enforcing")): return True else: return False