From 342c4ffb5a689c52f8b4b053d72b834f23cff558 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 10 Jun 2024 09:13:31 +0300 Subject: [PATCH] Fix(.vim/python/virtualenv.py): Only activate venv for the current version --- .vim/python/virtualenv.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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'), -- 2.39.2