]> git.phdru.name Git - dotfiles.git/commitdiff
Fix(.vim/python/virtualenv.py): Only activate venv for the current version master
authorOleg Broytman <phd@phdru.name>
Mon, 10 Jun 2024 06:13:31 +0000 (09:13 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 10 Jun 2024 06:13:31 +0000 (09:13 +0300)
.vim/python/virtualenv.py

index ed46739fb6774130b760abc3caef0a0017d711a5..62316009e94bfe707b5cdc5cf6b465283375ab03 100644 (file)
@@ -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'),