From d1fde3f4bc0b79b582de85d51965990b894dbe0c Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 20 Mar 2024 13:18:07 -0500
Subject: [PATCH] Fix pylint complaint about possibly unset XDG variable in
 test

---
 pytools/test/test_persistent_dict.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pytools/test/test_persistent_dict.py b/pytools/test/test_persistent_dict.py
index 58d6ba9..73d8f6e 100644
--- a/pytools/test/test_persistent_dict.py
+++ b/pytools/test/test_persistent_dict.py
@@ -588,8 +588,8 @@ def test_xdg_cache_home():
 
     assert not os.path.exists(xdg_dir)
 
+    old_xdg_cache_home = os.environ.get("XDG_CACHE_HOME")
     try:
-        old_xdg_cache_home = os.getenv("XDG_CACHE_HOME")
         os.environ["XDG_CACHE_HOME"] = xdg_dir
 
         PersistentDict("pytools-test")
-- 
GitLab