Skip to content

Commit 77c36ec

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3ad8a8e commit 77c36ec

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/attr/validators.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ def __call__(self, inst, attr, value):
348348
self.member_validator(inst, attr, member)
349349
except Exception as e:
350350
orig_msg = e.args[0] if e.args else str(e)
351-
if isinstance(orig_msg, str) and "'" + attr.name + "'" in orig_msg:
351+
if (
352+
isinstance(orig_msg, str)
353+
and "'" + attr.name + "'" in orig_msg
354+
):
352355
index_name = attr.name + "[" + str(idx) + "]"
353356
new_msg = orig_msg.replace(
354357
"'" + attr.name + "'",
@@ -416,7 +419,10 @@ def __call__(self, inst, attr, value):
416419
self.key_validator(inst, attr, key)
417420
except Exception as e:
418421
orig_msg = e.args[0] if e.args else str(e)
419-
if isinstance(orig_msg, str) and "'" + attr.name + "'" in orig_msg:
422+
if (
423+
isinstance(orig_msg, str)
424+
and "'" + attr.name + "'" in orig_msg
425+
):
420426
index_name = attr.name + "[key:" + repr(key) + "]"
421427
new_msg = orig_msg.replace(
422428
"'" + attr.name + "'",
@@ -431,7 +437,10 @@ def __call__(self, inst, attr, value):
431437
self.value_validator(inst, attr, value[key])
432438
except Exception as e:
433439
orig_msg = e.args[0] if e.args else str(e)
434-
if isinstance(orig_msg, str) and "'" + attr.name + "'" in orig_msg:
440+
if (
441+
isinstance(orig_msg, str)
442+
and "'" + attr.name + "'" in orig_msg
443+
):
435444
index_name = attr.name + "[" + repr(key) + "]"
436445
new_msg = orig_msg.replace(
437446
"'" + attr.name + "'",

0 commit comments

Comments
 (0)