X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a2f6706a1ea026cbe0e7d83caffa6c13c463bfe1..be35b1ed2d1f9453090bb29ac24abe997815ff70:/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'