Commit 4931ddd0 authored by pmacosta's avatar pmacosta Committed by Łukasz Langa
Browse files

Use g:pymode_python-defined interpreter if defined and exists, otherwise use...

Use g:pymode_python-defined interpreter if defined and exists, otherwise use existing defaults (#666)

This is helpful when using custom-compiled interpreters, or alternative
Python interpreters in non-standard locations
parent 14cbf737
Loading
Loading
Loading
Loading
+7 −0
Changes for plugin/black.vim: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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'