Skip to content

Commit

Permalink
Refactor check
Browse files Browse the repository at this point in the history
  • Loading branch information
RodoMa92 authored Aug 26, 2023
1 parent 63e57c0 commit 1d7f36c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/localplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def get_log_level() -> int:
def get_selinux() -> bool:
if ON_LINUX:
from subprocess import check_output
import shutil
if (shutil.which(getenforce) is not None and (check_output("getenforce").decode("ascii").strip("\n") is "Enforcing")):
return True
try:
if (check_output("getenforce").decode("ascii").strip("\n") == "Enforcing"): return True
except FileNotFoundError:
pass
return False

0 comments on commit 1d7f36c

Please sign in to comment.