60 lines
1.9 KiB
Diff
60 lines
1.9 KiB
Diff
From 5f7f38637b00b6ab1dc0771b590fd82d42b580c5 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
|
|
<alexey.pawlow@gmail.com>
|
|
Date: Thu, 17 Jun 2021 18:51:42 +0530
|
|
Subject: [PATCH 027/N] MINGW customize site
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
|
|
Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
|
|
---
|
|
Lib/site.py | 9 ++++++---
|
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/Lib/site.py b/Lib/site.py
|
|
index 9e617af..b344f03 100644
|
|
--- a/Lib/site.py
|
|
+++ b/Lib/site.py
|
|
@@ -251,7 +251,8 @@ def _getuserbase():
|
|
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 _getuserbase():
|
|
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,6 +331,7 @@ def getsitepackages(prefixes=None):
|
|
if prefixes is None:
|
|
prefixes = PREFIXES
|
|
|
|
+ from sysconfig import _POSIX_BUILD
|
|
for prefix in prefixes:
|
|
if not prefix or prefix in seen:
|
|
continue
|
|
@@ -338,7 +341,7 @@ def getsitepackages(prefixes=None):
|
|
if sys.platlibdir != "lib":
|
|
libdirs.append("lib")
|
|
|
|
- if os.sep == '/':
|
|
+ if _POSIX_BUILD:
|
|
for libdir in libdirs:
|
|
path = os.path.join(prefix, libdir,
|
|
"python%d.%d" % sys.version_info[:2],
|
|
--
|
|
2.35.1
|
|
|