From 053908448f0aad2a10d19d8bdc8a9b04320e2e90 Mon Sep 17 00:00:00 2001 From: Ariel Frischer Date: Sat, 8 Mar 2025 18:03:06 -0800 Subject: [PATCH] fix(env_inv.py): handle None values in sorting of installations to prevent errors (#117) --- ra_aid/env_inv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ra_aid/env_inv.py b/ra_aid/env_inv.py index 93d7aac..bfd3ec0 100644 --- a/ra_aid/env_inv.py +++ b/ra_aid/env_inv.py @@ -319,7 +319,8 @@ class EnvDiscovery: seen_paths.add(path) ver = self._get_python_version(path) installations.append({"version": ver, "path": path}) - installations = sorted(installations, key=lambda x: x.get("version", "")) + + installations = sorted(installations, key=lambda x: x.get("version", "") or "") self.results["python"]["installations"] = installations def _get_python_version(self, python_path):