From 0b158b61530015e0b5b86ca46b9212afecd0b0e8 Mon Sep 17 00:00:00 2001 From: Mariam Ahhttouche Date: Wed, 18 Feb 2026 11:18:14 +0100 Subject: [PATCH] uv_python module: refactor code --- plugins/modules/uv_python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/modules/uv_python.py b/plugins/modules/uv_python.py index ff69f87e51..76d9fbce09 100644 --- a/plugins/modules/uv_python.py +++ b/plugins/modules/uv_python.py @@ -87,7 +87,7 @@ class UV: """ rc, out, _ = self._find_python("--show-version") if rc == 0: - return False, out.split()[0], "", rc + return False, out.strip(), "", rc if self.module.check_mode: _, versions_available, _ = self._list_python() # when uv does not find any available patch version the install command will fail @@ -134,7 +134,7 @@ class UV: latest_version = self._get_latest_patch_release() if not latest_version: self.module.fail_json(msg=f"Version {self.python_version_str} is not available.") - if rc == 0 and out.split()[0] == latest_version: + if rc == 0 and out.strip() == latest_version: return False, latest_version, "", rc if self.module.check_mode: return True, latest_version, "", 0