From 32516ccfa0734277b7b98b6ccfffc059c368eadd Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 9 Jan 2025 16:40:44 +0100 Subject: [PATCH] tests/conftest.py: Use dict.pop instead of del to avoid KeyErrors If the key is not in the dict, pop still works without throwing any errors. This is just a bit safer. --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 71063c98c..f5f012d72 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -525,7 +525,7 @@ def xdg_document_portal( # FUSE and LD_PRELOAD don't like each other. Not sure what exactly is going # wrong but it usually just results in a weird hang that needs SIGKILL env = xdp_env.copy() - del env["LD_PRELOAD"] + env.pop("LD_PRELOAD", None) document_portal = subprocess.Popen([xdg_document_portal_path], env=env)