summaryrefslogtreecommitdiff
path: root/ez_setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-08-10 13:09:56 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-08-10 13:09:56 -0400
commit8e7f9858be7f4869b4ff9d9b81fea2093086be3d (patch)
tree5c0e76078ca468e45d943419c13c7840d7147b86 /ez_setup.py
parent3f9eef3cde6b1a03d64535fa02dd4f1c5d8b2a08 (diff)
downloadpython-setuptools-git-8e7f9858be7f4869b4ff9d9b81fea2093086be3d.tar.gz
Suppress output when checking viability of wget/curl. Fixed viability assignment and Windows platform detection.
Diffstat (limited to 'ez_setup.py')
-rw-r--r--ez_setup.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/ez_setup.py b/ez_setup.py
index 72d250a2..a9c9cbf0 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -156,7 +156,7 @@ def download_file_powershell(url, target):
subprocess.check_call(cmd)
download_file_powershell.viable = (
- lambda: platform.name() == 'Windows' and platform.win32_ver()[1] >= '6'
+ lambda: platform.system() == 'Windows' and platform.win32_ver()[1] >= '6'
)
def download_file_curl(url, target):
@@ -165,10 +165,13 @@ def download_file_curl(url, target):
def has_curl():
cmd = ['curl', '--version']
+ devnull = open(os.path.devnull, 'wb')
try:
- subprocess.check_call(cmd)
+ subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
except:
return False
+ finally:
+ devnull.close()
return True
download_file_curl.viable = has_curl
@@ -179,13 +182,16 @@ def download_file_wget(url, target):
def has_wget():
cmd = ['wget', '--version']
+ devnull = open(os.path.devnull, 'wb')
try:
- subprocess.check_call(cmd)
+ subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
except:
return False
+ finally:
+ devnull.close()
return True
-download_file_curl.viable = has_wget
+download_file_wget.viable = has_wget
def download_file_insecure(url, target):
"""