Skip to content

Correcting the pyinfo.py file #12207

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

Closed
wants to merge 1 commit into from
Closed

Correcting the pyinfo.py file #12207

wants to merge 1 commit into from

Conversation

soma2000-lang
Copy link

@soma2000-lang soma2000-lang commented Feb 18, 2022

Description

Made some change in the code

https://github.com/python/mypy/blob/master/mypy/pyinfo.py#L22

Test Plan

fixes issue #12202

@soma2000-lang
Copy link
Author

@hauntsaninja Please look into this

Copy link
Member

@emmatyping emmatyping left a comment

Choose a reason for hiding this comment

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

Hi, thank you for your PR. Unfortunately, these changes are not correct. The file does have to run under Python 2 (at least for now) since mypy can still type check Python 2 code. In addition, your change to the return of the getprefixes() function is not correct, instead of returning both the base_prefix and prefix (note the return type is a tuple of str), it will only return the prefix if the base prefix is None or the empty string.

@emmatyping
Copy link
Member

Oh I see you are trying to fix #12202. In that case I would change the check to be hasattr(sys, "base_prefix").

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Feb 23, 2022

Thank you, but superseded by #12244
Closing since this isn't a correct fix, it's been a couple days since Ethan's review, and I want to make sure the issue is fixed in the next release.

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.

3 participants