|
- diff -Naur Python-3.8.0-orig/Lib/site.py Python-3.8.0/Lib/site.py
- --- Python-3.8.0-orig/Lib/site.py 2019-10-14 16:34:47.000000000 +0300
- +++ Python-3.8.0/Lib/site.py 2019-10-22 10:02:21.776085800 +0300
- @@ -251,7 +251,8 @@
- def joinuser(*args):
- return os.path.expanduser(os.path.join(*args))
-
- - if os.name == "nt":
- + from sysconfig import _POSIX_BUILD
- + if os.name == "nt" and not _POSIX_BUILD:
- base = os.environ.get("APPDATA") or "~"
- return joinuser(base, "Python")
-
- @@ -266,7 +267,8 @@
- def _get_path(userbase):
- version = sys.version_info
-
- - if os.name == 'nt':
- + from sysconfig import _POSIX_BUILD
- + if sys.platform == 'win32' and not _POSIX_BUILD:
- return f'{userbase}\\Python{version[0]}{version[1]}\\site-packages'
-
- if sys.platform == 'darwin' and sys._framework:
- @@ -329,12 +331,13 @@
- if prefixes is None:
- prefixes = PREFIXES
-
- + from sysconfig import _POSIX_BUILD
- for prefix in prefixes:
- if not prefix or prefix in seen:
- continue
- seen.add(prefix)
-
- - if os.sep == '/':
- + if _POSIX_BUILD:
- sitepackages.append(os.path.join(prefix, "lib",
- "python%d.%d" % sys.version_info[:2],
- "site-packages"))
|