Skip to content

Commit

Permalink
Merge pull request #2045 from marshmallow-code/minor_integer_rework
Browse files Browse the repository at this point in the history
Rework Integer._validated
  • Loading branch information
lafrech committed Sep 8, 2022
2 parents f61dc84 + d86299e commit ba2b850
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/marshmallow/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,11 +998,7 @@ def __init__(self, *, strict: bool = False, **kwargs):

# override Number
def _validated(self, value):
if self.strict:
if isinstance(value, numbers.Number) and isinstance(
value, numbers.Integral
):
return super()._validated(value)
if self.strict and not isinstance(value, numbers.Integral):
raise self.make_error("invalid", input=value)
return super()._validated(value)

Expand Down

0 comments on commit ba2b850

Please sign in to comment.