Skip to content

Commit 57b5081

Browse files
allow notes to inherit codes
1 parent 9be5dc3 commit 57b5081

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mypy/errors.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,13 @@ def report(
551551

552552
code = code or (parent_error.code if parent_error else None)
553553
if code is None:
554-
if blocker or (severity == "note"):
554+
if blocker:
555555
code = None # do we even need to do this for blockers?
556+
elif (severity == "note"):
557+
if parent_error is not None:
558+
code = parent_error.code # this might be None, btw
559+
else:
560+
code = None
556561
else:
557562
code = codes.MISC
558563

0 commit comments

Comments
 (0)