Bug 1100925 - Added modification for MinGW64 version of Python so it will have system modules. r?gps draft
authorNathan Hakkakzadeh <nhakkakzadeh@mozilla.com>
Wed, 06 Jul 2016 14:16:50 -0700
changeset 387437 3059db92e6c3d36c9473862f106cef03f97b73af
parent 387436 5c05652a02e396877fc24613a0a98469dcb92bcb
child 387438 1802ec03836d5a32a80754f5f0dde76c1e24fe04
push id22949
push userbmo:nhakkakzadeh@mozilla.com
push dateWed, 13 Jul 2016 22:42:05 +0000
reviewersgps
bugs1100925
milestone50.0a1
Bug 1100925 - Added modification for MinGW64 version of Python so it will have system modules. r?gps Added a quick for MinGW64 then adds the default location of system modules to sys.path. MozReview-Commit-ID: IubUhpB3rOf
python/virtualenv/site.py
--- a/python/virtualenv/site.py
+++ b/python/virtualenv/site.py
@@ -574,17 +574,18 @@ def virtual_install_main_packages():
                                          'lib-python', 'modified-%s' % cpyver))
         hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below
         #
         # This is hardcoded in the Python executable, but relative to sys.prefix:
         for path in paths[:]:
             plat_path = os.path.join(path, 'plat-%s' % sys.platform)
             if os.path.exists(plat_path):
                 paths.append(plat_path)
-    elif sys.platform == 'win32':
+    # MOZ: The MSYS2 and MinGW versions of Python have their main packages in the UNIX directory this checks specifically for the native win32 python
+    elif sys.platform == 'win32' and os.sep == '\\':
         paths = [os.path.join(sys.real_prefix, 'Lib'), os.path.join(sys.real_prefix, 'DLLs')]
     else:
         paths = [os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3])]
         hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below
         lib64_path = os.path.join(sys.real_prefix, 'lib64', 'python'+sys.version[:3])
         if os.path.exists(lib64_path):
             if _is_64bit:
                 paths.insert(0, lib64_path)