Do not activate the current virtual environment
if it doesn't correspond to the vim's Python version.
if not os.path.exists(activate_this):
continue
if sys.version_info[0] == 2:
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))
- 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))