From 8b06842acc0b3faac0a6ee3a4081dd5a5a6b14af Mon Sep 17 00:00:00 2001 From: j Date: Sat, 6 Feb 2016 12:29:40 +0530 Subject: [PATCH] use distutils.spawn.find_executable --- install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install b/install index e3eaeda..e4bba9a 100755 --- a/install +++ b/install @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from __future__ import division, with_statement, print_function +import distutils.spawn from contextlib import closing import json import os @@ -8,7 +9,6 @@ import sys import tarfile from urllib.request import urlopen from threading import Thread -import subprocess def makedirs(dirname): if not os.path.exists(dirname): @@ -163,7 +163,8 @@ class Install(Thread): return self.base_url + url def has_bin(cmd): - return subprocess.call(['which', cmd], stdout=subprocess.PIPE) == 0 + path = distutils.spawn.find_executable(cmd) + return path != None if __name__ == '__main__': if len(sys.argv) == 1: