-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix pyinfo for Python 3.12 changes #15103
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,7 @@ | |
library found in Python 3.7. This file is run each mypy run, so it should be kept as fast as | ||
possible. | ||
""" | ||
import os | ||
import site | ||
import sys | ||
import sysconfig | ||
|
||
if __name__ == "__main__": | ||
# HACK: We don't want to pick up mypy.types as the top-level types | ||
|
@@ -22,6 +19,10 @@ | |
|
||
sys.path = old_sys_path | ||
|
||
import os | ||
import site | ||
import sysconfig | ||
|
||
|
||
def getsitepackages() -> list[str]: | ||
res = [] | ||
|
@@ -31,9 +32,7 @@ def getsitepackages() -> list[str]: | |
if hasattr(site, "getusersitepackages") and site.ENABLE_USER_SITE: | ||
res.insert(0, site.getusersitepackages()) | ||
else: | ||
from distutils.sysconfig import get_python_lib | ||
|
||
res = [get_python_lib()] | ||
res = [sysconfig.get_paths()["purelib"]] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something I don't recall, are purelib and sitepackages 1-to-1? I also don't recall if platdir is included in getsitepackages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yeah, I think what I have is equivalent to |
||
return res | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sysconfig now imports types, so we need to do the path hack sooner