summaryrefslogtreecommitdiff
path: root/virtualenv_embedded
diff options
context:
space:
mode:
authorPaul Nasrat <pnasrat@gmail.com>2012-12-24 12:50:00 -0800
committerPaul Nasrat <pnasrat@gmail.com>2012-12-24 12:50:00 -0800
commit38d56d9b83b9902c942412482b401fd72c2320bd (patch)
treefa30c701a41d6b88a7bd6a5f88a3d731247bca2f /virtualenv_embedded
parent2adac08acafca6b84aff4a294b8a27e54b18b6c9 (diff)
parent813fc02af8723421eeeadcb13eb361e2e44416ca (diff)
downloadvirtualenv-38d56d9b83b9902c942412482b401fd72c2320bd.tar.gz
Merge pull request #379 from warsaw/issue378
Fix for issue 378
Diffstat (limited to 'virtualenv_embedded')
-rw-r--r--virtualenv_embedded/site.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/virtualenv_embedded/site.py b/virtualenv_embedded/site.py
index 4271f43..a124586 100644
--- a/virtualenv_embedded/site.py
+++ b/virtualenv_embedded/site.py
@@ -584,9 +584,19 @@ def virtual_install_main_packages():
paths.insert(0, lib64_path)
else:
paths.append(lib64_path)
- # This is hardcoded in the Python executable, but relative to sys.prefix:
- plat_path = os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3],
- 'plat-%s' % sys.platform)
+ # This is hardcoded in the Python executable, but relative to
+ # sys.prefix. Debian change: we need to add the multiarch triplet
+ # here, which is where the real stuff lives. As per PEP 421, in
+ # Python 3.3+, this lives in sys.implementation, while in Python 2.7
+ # it lives in sys.
+ try:
+ arch = getattr(sys, 'implementation', sys)._multiarch
+ except AttributeError:
+ # This is a non-multiarch aware Python. Fallback to the old way.
+ arch = sys.platform
+ plat_path = os.path.join(sys.real_prefix, 'lib',
+ 'python'+sys.version[:3],
+ 'plat-%s' % arch)
if os.path.exists(plat_path):
paths.append(plat_path)
# This is hardcoded in the Python executable, but