virtualenv/res/lib/lib_create_env.py
changeset 83 b7aef101c7d1
parent 81 c6f9843db895
child 109 b823ac24bc88
--- a/virtualenv/res/lib/lib_create_env.py	Tue May 03 00:01:49 2011 +0200
+++ b/virtualenv/res/lib/lib_create_env.py	Tue May 03 17:17:17 2011 +0200
@@ -121,14 +121,18 @@
     #patch for linux
     if system_str == 'Linux' :
         olddir = os.getcwd()
-        patch_dest_path = os.path.join(lib_dir,'site-packages','setuptools-0.6c11-py'+'%s.%s' % (sys.version_info[0], sys.version_info[1])+'.egg')
-        if os.path.isfile(patch_dest_path):
-            # must unzip egg
-            # rename file and etract all
-            shutil.move(patch_dest_path, patch_dest_path + ".zip")
-            zf = zipfile.ZipFile(patch_dest_path + ".zip",'r')
-            zf.extractall(patch_dest_path)
-            os.remove(patch_dest_path + ".zip")
+        setuptools_path = os.path.join(lib_dir, 'site-packages', 'setuptools')
+        if os.path.exists(setuptools_path) and os.path.isdir(setuptools_path):
+            patch_dest_path = os.path.join(lib_dir, 'site-packages')
+        else:
+            patch_dest_path = os.path.join(lib_dir,'site-packages','setuptools-0.6c11-py%s.%s.egg' % (sys.version_info[0], sys.version_info[1]))
+            if os.path.isfile(patch_dest_path):
+                # must unzip egg
+                # rename file and etract all
+                shutil.move(patch_dest_path, patch_dest_path + ".zip")
+                zf = zipfile.ZipFile(patch_dest_path + ".zip",'r')
+                zf.extractall(patch_dest_path)
+                os.remove(patch_dest_path + ".zip")
         logger.notify("Patch jcc : %s " % (patch_dest_path))
         os.chdir(patch_dest_path)
         p = patch.fromfile(os.path.join(jcc_src_path,"jcc","patches","patch.43.0.6c11"))