Skip to content

Commit

Permalink
tests/conftest.py: Use dict.pop instead of del to avoid KeyErrors
Browse files Browse the repository at this point in the history
If the key is not in the dict, pop still works without throwing any
errors. This is just a bit safer.
  • Loading branch information
swick committed Jan 9, 2025
1 parent cb16d56 commit 32516cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 32516cc

Please sign in to comment.