Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions vex/make.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import os
import sys
import distutils.spawn
from vex.run import run
from vex import exceptions

try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which


PYDOC_SCRIPT = """#!/usr/bin/env python
from pydoc import cli
Expand Down Expand Up @@ -47,7 +51,7 @@ def handle_make(environ, options, make_path):
args = [ve, make_path]
if options.python:
if os.name == "nt":
python = distutils.spawn.find_executable(options.python)
python = which(options.python)
if python:
options.python = python
args += ["--python", options.python]
Expand Down
8 changes: 6 additions & 2 deletions vex/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
import os
import platform
import subprocess
import distutils.spawn
from vex import exceptions

try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which


def get_environ(environ, defaults, ve_path):
"""Make an environment to run with.
Expand Down Expand Up @@ -71,7 +75,7 @@ def run(command, env, cwd):
if cwd:
assert os.path.exists(cwd)
if platform.system() == "Windows":
exe = distutils.spawn.find_executable(command[0], path=env["PATH"])
exe = which(command[0], path=env["PATH"])
if exe:
command[0] = exe
_, command_name = os.path.split(command[0])
Expand Down