Prefer virtualenv packages over global packages (#1383) (#1384)

This commit is contained in:
kaiix 2020-05-08 21:31:37 +08:00 committed by GitHub
parent 8d6d92aa5b
commit 61f04e658b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,7 @@ def _initialize_black_env(upgrade=False):
if first_install:
print('Pro-tip: to upgrade Black in the future, use the :BlackUpgrade command and restart Vim.\n')
if virtualenv_site_packages not in sys.path:
sys.path.append(virtualenv_site_packages)
sys.path.insert(0, virtualenv_site_packages)
return True
if _initialize_black_env():