From: Oleg Broytman Date: Mon, 10 Jun 2024 06:13:31 +0000 (+0300) Subject: Fix(.vim/python/virtualenv.py): Only activate venv for the current version X-Git-Url: https://git.phdru.name/dotfiles.git/?a=commitdiff_plain;h=HEAD;p=dotfiles.git Fix(.vim/python/virtualenv.py): Only activate venv for the current version --- diff --git a/.vim/python/virtualenv.py b/.vim/python/virtualenv.py index ed46739..6231600 100644 --- a/.vim/python/virtualenv.py +++ b/.vim/python/virtualenv.py @@ -3,12 +3,12 @@ import sys, os # noqa: E401 multiple imports on one line virtualenv_dir = os.environ.get('VIRTUAL_ENV') if virtualenv_dir: if ( - (sys.version_info[0] == 2) - and os.path.exists( - os.path.join(virtualenv_dir, 'lib', 'python2.7')) - ) or ( - not os.path.exists( - os.path.join(virtualenv_dir, 'lib', 'python2.7')) + os.path.exists( + os.path.join( + virtualenv_dir, 'lib', + 'python%d.%d' % (sys.version_info[0], sys.version_info[1]) + ) + ) ): for activate_this in [ os.path.join(virtualenv_dir, 'bin', 'activate_this.py'),