Skip to content

Fix crashes with import * and aliases #2445

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

Merged
merged 1 commit into from
Nov 14, 2016

Conversation

ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Nov 13, 2016

Fixes #2315
Fixes #2172

There were reported some crashes of mypy when using import * and type aliases (only two above issues seem to be still open, others are closed as duplicates).

It looks like this is because visit_import_all in semanal.py does not copy type_override for imported nodes (visit_import_from does, so that the crashes reported happen only with import *).

I added few tests based on (extended) examples discussed in bug reports. Since the reason is clear and the fix is straightforward (one line) I think more sophisticated tests are not required.

@gvanrossum gvanrossum merged commit 19629d5 into python:master Nov 14, 2016
@gvanrossum
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal error with generic type and alias using import * Bug: traceback error from importing type with import *?
2 participants