We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 300c846 commit 7c5e69bCopy full SHA for 7c5e69b
mypy/util.py
@@ -607,8 +607,11 @@ def colorize(self, error: str) -> str:
607
return (loc + self.style('error:', 'red', bold=True) +
608
self.highlight_quote_groups(msg))
609
codepos = msg.rfind('[')
610
- code = msg[codepos:]
611
- msg = msg[:codepos]
+ if codepos != -1:
+ code = msg[codepos:]
612
+ msg = msg[:codepos]
613
+ else:
614
+ code = "" # no error code specified
615
616
self.highlight_quote_groups(msg) + self.style(code, 'yellow'))
617
elif ': note:' in error:
0 commit comments