Skip to content

Correcting the pyinfo.py file - #12207

Closed
soma2000-lang wants to merge 1 commit into
python:masterfrom
soma2000-lang:oma
Closed

soma2000-lang wants to merge 1 commit into
python:masterfrom
soma2000-lang:oma

Conversation

@soma2000-lang

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

Copy link
Copy Markdown

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
Copy Markdown
Author

@hauntsaninja Please look into this

@emmatyping emmatyping left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

hauntsaninja commented Feb 23, 2022 •

Copy link
Copy Markdown
Collaborator

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