aboutsummaryrefslogtreecommitdiffstats
path: root/ez_setup.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-08-26 21:27:34 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-08-26 21:27:34 -0400
commitae675b923b2079bad5d2bba83502cefc83a1edc2 (patch)
tree6fadcd8f364535a88cb2ef9be75d8d4fc2b12a95 /ez_setup.py
parent57e2b3119270044162edf4263b4ec7ea1e2adca9 (diff)
downloadexternal_python_setuptools-ae675b923b2079bad5d2bba83502cefc83a1edc2.tar.gz
external_python_setuptools-ae675b923b2079bad5d2bba83502cefc83a1edc2.tar.bz2
external_python_setuptools-ae675b923b2079bad5d2bba83502cefc83a1edc2.zip
Nest try/except/finally for use on Python 2.4. Fixes #72.1.1
Diffstat (limited to 'ez_setup.py')
-rw-r--r--ez_setup.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/ez_setup.py b/ez_setup.py
index 40db5a57..7a597d22 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -170,9 +170,10 @@ def has_powershell():
cmd = ['powershell', '-Command', 'echo test']
devnull = open(os.path.devnull, 'wb')
try:
- subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
- except:
- return False
+ try:
+ subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
+ except:
+ return False
finally:
devnull.close()
return True
@@ -187,9 +188,10 @@ def has_curl():
cmd = ['curl', '--version']
devnull = open(os.path.devnull, 'wb')
try:
- subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
- except:
- return False
+ try:
+ subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
+ except:
+ return False
finally:
devnull.close()
return True
@@ -204,9 +206,10 @@ def has_wget():
cmd = ['wget', '--version']
devnull = open(os.path.devnull, 'wb')
try:
- subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
- except:
- return False
+ try:
+ subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
+ except:
+ return False
finally:
devnull.close()
return True