X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a2f6706a1ea026cbe0e7d83caffa6c13c463bfe1..6b5eb7d4651c7333cc3f5df4bf7aa7a1f1ffb45b:/plugin/black.vim diff --git a/plugin/black.vim b/plugin/black.vim index 36825cf..15a13d1 100644 --- a/plugin/black.vim +++ b/plugin/black.vim @@ -37,10 +37,17 @@ if !exists("g:black_skip_string_normalization") endif python3 << endpython3 +import os import sys import vim def _get_python_binary(exec_prefix): + try: + default = vim.eval("g:pymode_python").strip() + except vim.error: + default = "" + if default and os.path.exists(default): + return default if sys.platform[:3] == "win": return exec_prefix / 'python.exe' return exec_prefix / 'bin' / 'python3'