Bug 1100925 - Added flags in virtualenv to differenciate between a native Windows version of Python and a MinGW64 version of Python running in msys2. r?gps draft
authorNathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Thu, 02 Jun 2016 13:19:28 -0700
changeset 387331 b147f21757d83c0d23a24766d40184bce2097689
parent 387330 703c049429ef1e39875974f5a262496590ec2c5b
child 387332 4e98c78b084c5cb1a41b5a386359bdaad565643d
push id22942
push userbmo:nhakkakzadeh@mozilla.com
push dateWed, 13 Jul 2016 21:21:35 +0000
reviewersgps
bugs1100925
milestone50.0a1
Bug 1100925 - Added flags in virtualenv to differenciate between a native Windows version of Python and a MinGW64 version of Python running in msys2. r?gps This is going to be necessary in the following commits to ensure that virtualenv has access to native libraries. MozReview-Commit-ID: FwxOoCWnQMW
python/virtualenv/virtualenv.py
--- a/python/virtualenv/virtualenv.py
+++ b/python/virtualenv/virtualenv.py
@@ -48,18 +48,19 @@ try:
     basestring
 except NameError:
     basestring = str
 
 py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1])
 
 is_jython = sys.platform.startswith('java')
 is_pypy = hasattr(sys, 'pypy_version_info')
-is_win = (sys.platform == 'win32')
+is_win = (sys.platform == 'win32' and os.sep == '\\')
 is_cygwin = (sys.platform == 'cygwin')
+is_msys2 = (sys.platform == 'win32' and os.sep == '/')
 is_darwin = (sys.platform == 'darwin')
 abiflags = getattr(sys, 'abiflags', '')
 
 user_dir = os.path.expanduser('~')
 if is_win:
     default_storage_dir = os.path.join(user_dir, 'virtualenv')
 else:
     default_storage_dir = os.path.join(user_dir, '.virtualenv')