Skip to content
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

Fix missing builtin aliases on Python 2 (and other versions) #6441

Merged
merged 4 commits into from Feb 21, 2019

Conversation

Projects
None yet
2 participants
@ilevkivskyi
Copy link
Collaborator

commented Feb 20, 2019

Some builtin aliases (like typing.ChainMap) are not available on some Python versions, or in some fixtures. However, if while they were first looked up while target namespace was incomplete, we put a PlaceholderNode in typing. This PR either doesn't put or removes this placeholder node if we didn't find the target after the target namespace is complete.

I didn't find a way to test this (since we don't have incremental pythoneval tests), but I double-checked this fixes the crash with actual Python 2 stubs.

@ilevkivskyi ilevkivskyi requested a review from JukkaL Feb 20, 2019

@JukkaL
Copy link
Collaborator

left a comment

I'm not sure if this a good way to fix this issue.

Show resolved Hide resolved mypy/newsemanal/semanal.py

@ilevkivskyi ilevkivskyi merged commit bd6af1c into python:master Feb 21, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ilevkivskyi ilevkivskyi deleted the ilevkivskyi:new-fix-builtin-aliases-2 branch Feb 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.