From 63805260bb5885937fcf49863c77b39724e8137d 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?= Date: Thu, 17 Jun 2021 18:51:42 +0530 Subject: [PATCH 026/N] site: Customize for MINGW MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Алексей Co-authored-by: Christoph Reiter --- Lib/site.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py index 041dca1..b87f05c 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -299,7 +299,7 @@ def _getuserbase(): def joinuser(*args): return os.path.expanduser(os.path.join(*args)) - if os.name == "nt": + if os.name == "nt" and not sys._is_mingw: base = os.environ.get("APPDATA") or "~" return joinuser(base, _get_implementation()) @@ -320,7 +320,7 @@ def _get_path(userbase): implementation = _get_implementation() implementation_lower = implementation.lower() - if os.name == 'nt': + if os.name == 'nt' and not sys._is_mingw: ver_nodot = sys.winver.replace('.', '') return f'{userbase}\\{implementation}{ver_nodot}\\site-packages' @@ -399,7 +399,7 @@ def getsitepackages(prefixes=None): abi_thread = 't' else: abi_thread = '' - if os.sep == '/': + if os.name == 'posix' or sys._is_mingw: libdirs = [sys.platlibdir] if sys.platlibdir != "lib": libdirs.append("lib") @@ -430,7 +430,7 @@ def setquit(): The repr of each object contains a hint at how it works. """ - if os.sep == '\\': + if sys.platform == 'win32': eof = 'Ctrl-Z plus Return' else: eof = 'Ctrl-D (i.e. EOF)'