]> git.phdru.name Git - dotfiles.git/blobdiff - .vim/python/virtualenv.py
Feat(.vim/python/virtualenv.py): Check major Python version
[dotfiles.git] / .vim / python / virtualenv.py
index 9341bc79f9663e407650941be798519bd73e4351..ca66bf8854095a10d459ace69cf34b4ac63066bd 100644 (file)
@@ -10,7 +10,13 @@ if virtualenv_dir:
         if not os.path.exists(activate_this):
             continue
         if sys.version_info[0] == 2:
-            execfile(activate_this, dict(__file__=activate_this))
+            if os.path.exists(
+                    os.path.join(virtualenv_dir, 'lib', 'python2.7')):
+                execfile(activate_this,
+                         dict(__file__=activate_this))
         else:
-            exec(open(activate_this, 'r').read(), dict(__file__=activate_this))
+            if not os.path.exists(
+                    os.path.join(virtualenv_dir, 'lib', 'python2.7')):
+                exec(open(activate_this, 'r').read(),
+                     dict(__file__=activate_this))
         break