diff options
author | atomlong | 2021-10-23 17:55:22 +0800 |
---|---|---|
committer | atomlong | 2021-10-23 18:06:15 +0800 |
commit | 80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch) | |
tree | b48dd1e73de9ea35a4709fb6b93deb16331ec514 /0071-venv-creation-fixes.patch | |
parent | 89a67c05174951d172252b1db96ff93cc4ec4bcd (diff) | |
download | aur-mingw-w64-python.tar.gz |
update to 3.9.7
Diffstat (limited to '0071-venv-creation-fixes.patch')
-rw-r--r-- | 0071-venv-creation-fixes.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/0071-venv-creation-fixes.patch b/0071-venv-creation-fixes.patch new file mode 100644 index 000000000000..fb3f5d66d30d --- /dev/null +++ b/0071-venv-creation-fixes.patch @@ -0,0 +1,71 @@ +From c82449ed5fed227754cfe841e67b7591b8683ed7 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter <reiter.christoph@gmail.com> +Date: Thu, 17 Jun 2021 18:52:26 +0530 +Subject: [PATCH 071/N] venv creation fixes + +--- + Lib/venv/__init__.py | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py +index 8009deb..b471006 100644 +--- a/Lib/venv/__init__.py ++++ b/Lib/venv/__init__.py +@@ -11,6 +11,7 @@ import subprocess + import sys + import sysconfig + import types ++from sysconfig import _POSIX_BUILD + + + CORE_VENV_DEPS = ('pip', 'setuptools') +@@ -119,7 +120,7 @@ class EnvBuilder: + 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') +@@ -252,7 +253,7 @@ class EnvBuilder: + if not os.path.islink(path): + os.chmod(path, 0o755) + else: +- if self.symlinks: ++ if self.symlinks and not _POSIX_BUILD: + # For symlinking, we need a complete copy of the root directory + # If symlinks fail, you'll get unnecessary copies of files, but + # we assume that if you've opted into symlinks on Windows then +@@ -275,7 +276,13 @@ class EnvBuilder: + if os.path.lexists(src): + copier(src, os.path.join(binpath, suffix)) + +- if sysconfig.is_python_build(True): ++ if _POSIX_BUILD: ++ # copy from python/pythonw so the venvlauncher magic in symlink_or_copy triggers ++ copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python3.exe')) ++ copier(os.path.join(dirname, 'python.exe'), os.path.join(binpath, 'python%d.%d.exe' % sys.version_info[:2])) ++ copier(os.path.join(dirname, 'pythonw.exe'), os.path.join(binpath, 'python3w.exe')) ++ ++ if sysconfig.is_python_build(True) and not _POSIX_BUILD: + # copy init.tcl + for root, dirs, files in os.walk(context.python_dir): + if 'init.tcl' in files: +@@ -293,9 +300,11 @@ class EnvBuilder: + # We run ensurepip in isolated mode to avoid side effects from + # environment vars, the current directory and anything else + # intended for the global Python environment ++ env = os.environ.copy() ++ env.pop("MSYSTEM", None) + cmd = [context.env_exe, '-Im', 'ensurepip', '--upgrade', +- '--default-pip'] +- subprocess.check_output(cmd, stderr=subprocess.STDOUT) ++ '--default-pip'] ++ subprocess.check_call(cmd, stderr=subprocess.STDOUT, env=env) + + def setup_scripts(self, context): + """ +-- +2.33.0 + |