From 204cd189da9295961c20ba45c878666497d6e3f4 Mon Sep 17 00:00:00 2001 From: Dan Masteller Date: Fri, 6 Jan 2023 16:00:43 -0600 Subject: [PATCH] Use major version if python installed in custom path --- selinux/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selinux/__init__.py b/selinux/__init__.py index ef94efd..7061a3d 100644 --- a/selinux/__init__.py +++ b/selinux/__init__.py @@ -77,6 +77,9 @@ def get_system_sitepackages(): [str(item) for item in platform.python_version_tuple()[0:2]] ) + if not os.path.isfile(system_python): + system_python = "/usr/bin/python%s" % platform.python_version_tuple()[0] + system_sitepackages = json.loads( subprocess.check_output( [