Fix handling of mismatched Python version in virtualenv #4675
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fixes #2547 for the (default) case when
g:black_use_virtualenv = 1
.The fix for
g:black_use_virtualenv = 0
is a superset of these changes but is more invasive so I'll create a separate branch for it.To trigger the bug on Linux:
black
installed as a system package:apt purge black
:BlackVersion
, let it finish creating the virtualenv, close vim:BlackVersion
, you should see an error:ModuleNotFoundError: No module named 'black'
I usually encounter this issue when I upgrade to a new Kubuntu release which has a newer Vim built against a newer Python, since I keep the same user data so the old virtualenv created for black is still there.
Checklist - did you ...
CHANGES.md
if necessary?