Skip to content

Commit 0e8faa6

Browse files
committed
check for python iteratively only as necessary
1 parent 16697b8 commit 0e8faa6

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

sublime_python.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,13 @@ def proxy_for(view):
326326
requested interpreter'''
327327
proxy = None
328328
with PROXY_LOCK:
329-
pythons = (
330-
normalize_path(get_setting("python_interpreter", view, ""), True),
331-
normalize_path(project_venv_python(view)),
332-
normalize_path(shebang_line_python(view)),
333-
normalize_path(system_python()),
334-
)
335-
336-
python = pythons[0] or pythons[1] or pythons[2] or pythons[3]
329+
python = normalize_path(get_setting("python_interpreter", view, ""), True)
330+
if not python:
331+
python = normalize_path(project_venv_python(view))
332+
if not python:
333+
python = normalize_path(shebang_line_python(view))
334+
if not python:
335+
python = normalize_path(system_python())
337336

338337
if not python or not os.path.exists(python[0]):
339338
raise OSError("""

0 commit comments

Comments
 (0)