We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba35026 commit a2b0f18Copy full SHA for a2b0f18
mypy/pyinfo.py
@@ -7,10 +7,7 @@
7
library found in Python 3.7. This file is run each mypy run, so it should be kept as fast as
8
possible.
9
"""
10
-import os
11
-import site
12
import sys
13
-import sysconfig
14
15
if __name__ == "__main__":
16
# HACK: We don't want to pick up mypy.types as the top-level types
@@ -22,6 +19,10 @@
22
19
23
20
sys.path = old_sys_path
24
21
+import os
+import site
+import sysconfig
25
+
26
27
def getsitepackages() -> list[str]:
28
res = []
@@ -31,9 +32,7 @@ def getsitepackages() -> list[str]:
31
32
if hasattr(site, "getusersitepackages") and site.ENABLE_USER_SITE:
33
res.insert(0, site.getusersitepackages())
34
else:
- from distutils.sysconfig import get_python_lib
35
-
36
- res = [get_python_lib()]
+ res = [sysconfig.get_paths()["purelib"]]
37
return res
38
39
0 commit comments