Skip to content

Commit

Permalink
Avoid over-eager KeyError on empty dict.pop (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
pschanely committed Mar 16, 2024
1 parent 24aa9d1 commit 6b4acce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crosshair/simplestructs.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def pop(self, key, default=_MISSING):
return value
# Not found:
if default is _MISSING:
raise
raise KeyError(key)
return default

def popitem(self):
Expand Down

0 comments on commit 6b4acce

Please sign in to comment.