X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.vim%2Fpython%2Fvirtualenv.py;fp=.vim%2Fpython%2Fvirtualenv.py;h=ca66bf8854095a10d459ace69cf34b4ac63066bd;hp=9341bc79f9663e407650941be798519bd73e4351;hb=353abf00b2c4c65a8befd5efa8d992e56667c257;hpb=4012586325e2641a1ea2a960bdeebb7422f3cc9e diff --git a/.vim/python/virtualenv.py b/.vim/python/virtualenv.py index 9341bc7..ca66bf8 100644 --- a/.vim/python/virtualenv.py +++ b/.vim/python/virtualenv.py @@ -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