diff --git a/src/werkzeug/datastructures/structures.py b/src/werkzeug/datastructures/structures.py index 719ddbca76..69bfa2fa4e 100644 --- a/src/werkzeug/datastructures/structures.py +++ b/src/werkzeug/datastructures/structures.py @@ -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