Commit ae675b92 authored by Jason R. Coombs's avatar Jason R. Coombs

Nest try/except/finally for use on Python 2.4. Fixes #72.

parent 57e2b311
......@@ -8,6 +8,7 @@ CHANGES
* Issue #71 (Distribute Issue #333): EasyInstall now puts less emphasis on the
condition when a host is blocked via ``--allow-hosts``.
* Issue #72: Restored Python 2.4 compatibility in ``ez_setup.py``.
---
1.0
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment