Skip to content

Commit cea3d44

Browse files
authored
Simplify use of self.opts.index_errors in _deserialize (#2988)
1 parent 7bb19f0 commit cea3d44

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/marshmallow/schema.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,7 @@ def _deserialize(
620620
:return: The deserialized data as `dict_class` instance or list of `dict_class`
621621
instances if `many` is `True`.
622622
"""
623-
index_errors = self.opts.index_errors
624-
index = index if index_errors else None
623+
index = index if self.opts.index_errors else None
625624
if many:
626625
if not is_sequence_but_not_string(data):
627626
error_store.store_error([self.error_messages["type"]], index=index)
@@ -701,7 +700,7 @@ def getter(
701700
error_store.store_error(
702701
[self.error_messages["unknown"]],
703702
key,
704-
(index if index_errors else None),
703+
index,
705704
)
706705
return ret_d
707706

0 commit comments

Comments
 (0)