Skip to content

Fix 7412: Exception while typechecking: KeyError: 'typing' #7459

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 2 commits into from
Sep 5, 2019

Conversation

gantsevdenis
Copy link
Contributor

fix for #7412 looks pretty simple... not sure if this solution is general enough

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Just one suggestion.

mypy/build.py Outdated
@@ -2303,6 +2303,7 @@ def find_module_and_diagnose(manager: BuildManager,
if (root_source # Honor top-level modules
or (not path.endswith('.py') # Stubs are always normal
and not options.follow_imports_for_stubs) # except when they aren't
or id == 'typing' # typing is not a stub, and is always normal
Copy link
Member

@ilevkivskyi ilevkivskyi Sep 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense, to make it more general maybe use id not in mypy.semanal_main.core_modules instead of this line and the below one?

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

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.

2 participants