Blob Blame History Raw
From bf1a25c4a0f80cd9ae4e0dca3819b5bfb2448fcf Mon Sep 17 00:00:00 2001
From: Nathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Date: Thu, 2 Jun 2016 14:29:26 -0700
Subject: [PATCH 07/12] Bug 1100925 - Virtualenv no longer attempts to use
 symlinks when the os module does not have it. r=gps

Before, virtualenv would try to use symlinks based entirely on the value given by the options parser.

Unfortunately, some versions of Python cannot symlink (specifically the MinGW version of Python).

Now, virtualenv ensures the os module has the symlink funciton before attempting to use the symlink function.

MozReview-Commit-ID: DFJ59AaPNpB

--HG--
extra : rebase_source : 4a92c9cbfbfe205e18b890e100fe549d78cebc81

(cherry picked from commit 2608abcab568a9f705c7f519d9b30c01cc1790df)
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
---
 python/virtualenv/virtualenv.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/virtualenv/virtualenv.py b/python/virtualenv/virtualenv.py
index 442c6e3a5b2e..bfa9407715b1 100755
--- a/python/virtualenv/virtualenv.py
+++ b/python/virtualenv/virtualenv.py
@@ -708,7 +708,7 @@ def main():
                        no_setuptools=options.no_setuptools,
                        no_pip=options.no_pip,
                        no_wheel=options.no_wheel,
-                       symlink=options.symlink)
+                       symlink=options.symlink and hasattr(os, 'symlink')) # MOZ: Make sure we don't use symlink when we don't have it
     if 'after_install' in globals():
         after_install(options, home_dir)
 
-- 
2.24.1