-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Internal error when identifier in except clause shadows imported module name #9615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
It's worth noting that a very similar problem occurs when the identifier in the
This results in |
hauntsaninja
pushed a commit
to hauntsaninja/mypy
that referenced
this issue
May 30, 2021
Fixes python#9615, fixes python#9682 Both issue reports hit the faulty cast on L2803. This changes the logic so that that cast is actually always true. If not, we just end up doing whatever the fallback else clause does; this resulted in behaviour that matched what I expected. After that, the python#9682 hit another crash in checker.py, where var.node was None instead of a Var. It seemed reasonable to just branch instead.
hauntsaninja
pushed a commit
to hauntsaninja/mypy
that referenced
this issue
May 30, 2021
Fixes python#9615, fixes python#9682 Both issue reports hit the faulty cast on L2803. This changes the logic so that that cast is actually always true. If not, we just end up doing whatever the fallback else clause does; this resulted in behaviour that matched what I expected. After that, the python#9682 hit another crash in checker.py, where var.node was None instead of a Var. It seemed reasonable to just branch instead.
JukkaL
pushed a commit
that referenced
this issue
Jun 18, 2021
Fixes #9615, fixes #9682 Both issue reports hit the faulty cast on L2803. This changes the logic so that that cast is actually always true. If not, we just end up doing whatever the fallback else clause does; this resulted in behaviour that matched what I expected. After that, the #9682 hit another crash in checker.py, where var.node was None instead of a Var. It seemed reasonable to just branch instead. Co-authored-by: hauntsaninja <>
JukkaL
pushed a commit
that referenced
this issue
Jun 21, 2021
Fixes #9615, fixes #9682 Both issue reports hit the faulty cast on L2803. This changes the logic so that that cast is actually always true. If not, we just end up doing whatever the fallback else clause does; this resulted in behaviour that matched what I expected. After that, the #9682 hit another crash in checker.py, where var.node was None instead of a Var. It seemed reasonable to just branch instead. Co-authored-by: hauntsaninja <>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Crash Report
Mypy crashes while analysing a
try
statement in which one of theexcept
clauses uses the same identifier as one of the imported modules.Traceback
To Reproduce
bug.py contents:
Command:
mypy bug.py
Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: