From f90a041921bf0c9759297b19ec1a344c7ac324ee Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Wed, 11 Dec 2024 12:23:27 +0100 Subject: [PATCH] limit buildpath.py setuptools version check to the relevant bits previously, this check would fail if the setuptools version would contain non-integers. On my system, that is the case: `setuptools.__version__` is `'75.1.0.post0'` I believe it is entirely fair to just check the relevant bits and refuse to continue if those can not be checked properly. But haviong something extra on the version should not immediately cause issues (e.g. the `post0` here, or slugs like `beta`, `alpha` and the likes). Probably only very few systems are running setuptools with weird version info, but supporting this doesn't cost much, i believe. (cherry picked from commit 3302ae98e42b0a02018d4c743aa71c179377c274) Signed-off-by: John Johansen --- libraries/libapparmor/swig/python/test/buildpath.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libapparmor/swig/python/test/buildpath.py b/libraries/libapparmor/swig/python/test/buildpath.py index a9c4728a2..63d70f794 100644 --- a/libraries/libapparmor/swig/python/test/buildpath.py +++ b/libraries/libapparmor/swig/python/test/buildpath.py @@ -7,7 +7,7 @@ import sysconfig import setuptools -if tuple(map(int, setuptools.__version__.split("."))) >= (62, 1): +if tuple(map(int, setuptools.__version__.split(".")[:2])) >= (62, 1): identifier = sys.implementation.cache_tag else: identifier = "%d.%d" % sys.version_info[:2]