Files
MINGW-packages/mingw-w64-python3/2050-undo-venv-redirector.patch
2019-10-23 13:58:54 +03:00

39 lines
1.4 KiB
Diff

diff -Naur Python-3.8.0-orig/Lib/venv/__init__.py Python-3.8.0/Lib/venv/__init__.py
--- Python-3.8.0-orig/Lib/venv/__init__.py 2019-10-14 16:34:47.000000000 +0300
+++ Python-3.8.0/Lib/venv/__init__.py 2019-10-22 10:05:19.975198800 +0300
@@ -11,6 +11,7 @@
import sys
import sysconfig
import types
+from sysconfig import _POSIX_BUILD
logger = logging.getLogger(__name__)
@@ -110,7 +111,7 @@
context.executable = executable
context.python_dir = dirname
context.python_exe = exename
- if sys.platform == 'win32':
+ if sys.platform == 'win32' and not _POSIX_BUILD:
binname = 'Scripts'
incpath = 'Include'
libpath = os.path.join(env_dir, 'Lib', 'site-packages')
@@ -156,7 +157,7 @@
if self.prompt is not None:
f.write(f'prompt = {self.prompt!r}\n')
- if os.name != 'nt':
+ if os.name != 'nt' or _POSIX_BUILD:
def symlink_or_copy(self, src, dst, relative_symlinks_ok=False):
"""
Try symlinking a file, and if that fails, fall back to copying.
@@ -230,7 +231,7 @@
path = context.env_exe
copier = self.symlink_or_copy
dirname = context.python_dir
- if os.name != 'nt':
+ if os.name != 'nt' or _POSIX_BUILD:
copier(context.executable, path)
if not os.path.islink(path):
os.chmod(path, 0o755)