diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-26 21:27:34 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-26 21:27:34 -0400 |
commit | 05e20cbd929734128e69b7dde725261c98fd8f45 (patch) | |
tree | d9f986dbe8a08b9f17e3157224e9dfad87b8bd6a | |
parent | f251a365b4352cdb6325a88654ecfc3627841d96 (diff) | |
download | python-setuptools-bitbucket-1.1.tar.gz |
Nest try/except/finally for use on Python 2.4. Fixes #72.1.1
-rw-r--r-- | CHANGES.txt | 1 | ||||
-rw-r--r-- | ez_setup.py | 21 |
2 files changed, 13 insertions, 9 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 70c0ffd6..3e2caeb0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 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 |