Skip to content

Commit

Permalink
Fix Coerce validator to catch decimal.InvalidOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymofii Trukhanov authored and alecthomas committed May 31, 2017
1 parent 85b96b3 commit 2392366
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion voluptuous/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(self, type, msg=None):
def __call__(self, v):
try:
return self.type(v)
except (ValueError, TypeError):
except (ValueError, TypeError, InvalidOperation):
msg = self.msg or ('expected %s' % self.type_name)
raise CoerceInvalid(msg)

Expand Down

0 comments on commit 2392366

Please sign in to comment.