update
This commit is contained in:
29
.CondaPkg/env/Lib/venv/__init__.py
vendored
29
.CondaPkg/env/Lib/venv/__init__.py
vendored
@@ -102,6 +102,33 @@ class EnvBuilder:
|
||||
}
|
||||
return sysconfig.get_path(name, scheme='venv', vars=vars)
|
||||
|
||||
@classmethod
|
||||
def _same_path(cls, path1, path2):
|
||||
"""Check whether two paths appear the same.
|
||||
|
||||
Whether they refer to the same file is irrelevant; we're testing for
|
||||
whether a human reader would look at the path string and easily tell
|
||||
that they're the same file.
|
||||
"""
|
||||
if sys.platform == 'win32':
|
||||
if os.path.normcase(path1) == os.path.normcase(path2):
|
||||
return True
|
||||
# gh-90329: Don't display a warning for short/long names
|
||||
import _winapi
|
||||
try:
|
||||
path1 = _winapi.GetLongPathName(os.fsdecode(path1))
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
path2 = _winapi.GetLongPathName(os.fsdecode(path2))
|
||||
except OSError:
|
||||
pass
|
||||
if os.path.normcase(path1) == os.path.normcase(path2):
|
||||
return True
|
||||
return False
|
||||
else:
|
||||
return path1 == path2
|
||||
|
||||
def ensure_directories(self, env_dir):
|
||||
"""
|
||||
Create the directories for the environment.
|
||||
@@ -162,7 +189,7 @@ class EnvBuilder:
|
||||
# bpo-45337: Fix up env_exec_cmd to account for file system redirections.
|
||||
# Some redirects only apply to CreateFile and not CreateProcess
|
||||
real_env_exe = os.path.realpath(context.env_exe)
|
||||
if os.path.normcase(real_env_exe) != os.path.normcase(context.env_exe):
|
||||
if not self._same_path(real_env_exe, context.env_exe):
|
||||
logger.warning('Actual environment location may have moved due to '
|
||||
'redirects, links or junctions.\n'
|
||||
' Requested location: "%s"\n'
|
||||
|
||||
Reference in New Issue
Block a user