False exception error in raise statement with a ternary conditional operator #5128
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-join-v-union
Using join vs. using unions
topic-ternary-expression
a if b else c
I faced with a strange mypy error, with such a code below:
It seems legal code, but mypy produces two error messages there.
Actually, this error seems to happen not only with
Exception
but with any other built-in exceptions.The version of mypy is 0.600, and that of Python is 3.6.3.
Thanks in advance.
The text was updated successfully, but these errors were encountered: