Skip to content

Commit 9764e29

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 605cb9b commit 9764e29

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/attr/validators.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,13 +407,17 @@ def __call__(self, inst, attr, value):
407407
try:
408408
self.key_validator(inst, attr, key)
409409
except (ValueError, TypeError) as e:
410-
msg = str(e).replace(f"'{attr.name}'", f"'{attr.name}[key:{key!r}]'")
410+
msg = str(e).replace(
411+
f"'{attr.name}'", f"'{attr.name}[key:{key!r}]'"
412+
)
411413
raise type(e)(msg) from None
412414
if self.value_validator is not None:
413415
try:
414416
self.value_validator(inst, attr, value[key])
415417
except (ValueError, TypeError) as e:
416-
msg = str(e).replace(f"'{attr.name}'", f"'{attr.name}[{key!r}]'")
418+
msg = str(e).replace(
419+
f"'{attr.name}'", f"'{attr.name}[{key!r}]'"
420+
)
417421
raise type(e)(msg) from None
418422

419423
def __repr__(self):

0 commit comments

Comments
 (0)