Skip to content

Commit

Permalink
Rework Schema._bind_field to fix mypy error
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Dec 19, 2022
1 parent 563ad7e commit 519aa8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/marshmallow/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,9 @@ def _bind_field(self, field_name: str, field_obj: ma_fields.Field) -> None:
# the type checker's perspective.
if isinstance(field_obj, type) and issubclass(field_obj, base.FieldABC):
msg = (
'Field for "{}" must be declared as a '
'Field for "{field_name}" must be declared as a '
"Field instance, not a class. "
'Did you mean "fields.{}()"?'.format(field_name, field_obj.__name__)
'Did you mean "fields.{field_obj.__name__}()"?'
)
raise TypeError(msg) from error
raise error
Expand Down

0 comments on commit 519aa8d

Please sign in to comment.