Skip to content

Commit

Permalink
explain try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinKonowalczyk committed Apr 26, 2024
1 parent 4d8b1c2 commit 38d436d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/werkzeug/datastructures/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def pop(self, key, default=_missing, type=None):
return None
return default
try:
# This method is not meant to be thread-safe, but at least lets not
# fall over if the dict was mutated between the get and the delete.
del self[key]
except KeyError:
pass
Expand Down

0 comments on commit 38d436d

Please sign in to comment.