From fd03fb1ed0c475128bada45b90f4f2302aa0c1b7 Mon Sep 17 00:00:00 2001 From: Thomas Perrot Date: Tue, 5 May 2026 17:26:47 +0200 Subject: [PATCH] query: fix variable shadowing in file_exists() The loop variable "path" shadowed the function parameter of the same name. After populating the cache, line 103 compared the last iterated path against the cache instead of the requested path, causing file_exists() to incorrectly return True on the first call for any given version. Signed-off-by: Thomas Perrot --- elixir/query.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elixir/query.py b/elixir/query.py index c0f7274..e3e4ffd 100755 --- a/elixir/query.py +++ b/elixir/query.py @@ -91,12 +91,12 @@ class Query: if version not in self.file_cache: version_cache = set() last_dir = None - for _, path in self.db.vers.get(version).iter(): - dirname, filename = os.path.split(path) + for _, file_path in self.db.vers.get(version).iter(): + dirname, filename = os.path.split(file_path) if dirname != last_dir: last_dir = dirname version_cache.add(dirname) - version_cache.add(path) + version_cache.add(file_path) self.file_cache[version] = version_cache