X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a2f6706a1ea026cbe0e7d83caffa6c13c463bfe1..d410763d8d4f5874113c9ad32edd9354c4e5589a:/plugin/black.vim?ds=sidebyside 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'