summaryrefslogtreecommitdiffstats
path: root/Lib/venv
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2014-04-15 10:18:10 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2014-04-15 10:18:10 (GMT)
commit1e53f8d9bff9d9a7f6ea27aa0aea9eaca5307cc6 (patch)
tree8f0da74d360fc08bc390e370d7336b4e17889b4e /Lib/venv
parenta0d107324d38ab6fc5af4c6fee272e1097f98f49 (diff)
downloadcpython-1e53f8d9bff9d9a7f6ea27aa0aea9eaca5307cc6.zip
cpython-1e53f8d9bff9d9a7f6ea27aa0aea9eaca5307cc6.tar.gz
cpython-1e53f8d9bff9d9a7f6ea27aa0aea9eaca5307cc6.tar.bz2
Issue #21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX.
Diffstat (limited to 'Lib/venv')
-rw-r--r--Lib/venv/__init__.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index bbdd911..20dafc0 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -1,7 +1,7 @@
"""
Virtual environment (venv) package for Python. Based on PEP 405.
-Copyright (C) 2011-2012 Vinay Sajip.
+Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
usage: python -m venv [-h] [--system-site-packages] [--symlinks] [--clear]
@@ -30,6 +30,7 @@ optional arguments:
import logging
import os
import shutil
+import struct
import subprocess
import sys
import types
@@ -132,10 +133,18 @@ class EnvBuilder:
else:
binname = 'bin'
incpath = 'include'
- libpath = os.path.join(env_dir, 'lib', 'python%d.%d' % sys.version_info[:2], 'site-packages')
+ libpath = os.path.join(env_dir, 'lib',
+ 'python%d.%d' % sys.version_info[:2],
+ 'site-packages')
context.inc_path = path = os.path.join(env_dir, incpath)
create_if_needed(path)
create_if_needed(libpath)
+ # Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX
+ if ((struct.calcsize('P') == 8) and (os.name == 'posix') and
+ (sys.platform != 'darwin')):
+ p = os.path.join(env_dir, 'lib')
+ link_path = os.path.join(env_dir, 'lib64')
+ os.symlink(p, link_path)
context.bin_path = binpath = os.path.join(env_dir, binname)
context.bin_name = binname
context.env_exe = os.path.join(binpath, exename)