0017-venv-Revert-a-change-from-https-github.com-python-cp.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From f6559d3e3adb952d3c007a084166cc5da1bd9873 Mon Sep 17 00:00:00 2001
  2. From: Ray Donnelly <mingw.android@gmail.com>
  3. Date: Wed, 2 Jan 2019 21:38:48 +0000
  4. Subject: [PATCH 17/30] venv: Revert a change from
  5. https://github.com/python/cpython/commit/1c3de541e64f75046b20cdd27bada1557e550bcd
  6. https://bugs.python.org/issue35644
  7. If copier(context.executable, path) is not also called on Windows (as it was in Python 3.7.1) then the venv\Scripts dir will not contain a Python exe
  8. Also, on Anaconda Distribution, python.exe lives in sys.prefix.
  9. ---
  10. Lib/venv/__init__.py | 9 +++++++--
  11. 1 file changed, 7 insertions(+), 2 deletions(-)
  12. diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
  13. index 8009deb3ea..e4fd6db818 100644
  14. --- a/Lib/venv/__init__.py 2022-03-21 10:56:11.539903117 +0300
  15. +++ b/Lib/venv/__init__.py 2022-03-21 10:56:19.880049661 +0300
  16. @@ -234,7 +234,12 @@
  17. basename = 'venvwlauncher'
  18. src = os.path.join(os.path.dirname(src), basename + ext)
  19. else:
  20. - src = srcfn
  21. + if basename.startswith('python'):
  22. + scripts = sys.prefix
  23. + else:
  24. + scripts = os.path.join(os.path.dirname(__file__), "scripts", "nt")
  25. + src = os.path.join(scripts, basename + ext)
  26. +
  27. if not os.path.exists(src):
  28. if not bad_src:
  29. logger.warning('Unable to copy %r', src)
  30. @@ -252,9 +257,9 @@
  31. binpath = context.bin_path
  32. path = context.env_exe
  33. copier = self.symlink_or_copy
  34. + copier(context.executable, path)
  35. dirname = context.python_dir
  36. if os.name != 'nt':
  37. - copier(context.executable, path)
  38. if not os.path.islink(path):
  39. os.chmod(path, 0o755)
  40. for suffix in ('python', 'python3', f'python3.{sys.version_info[1]}'):