patch ez_setup_1_4_2.py to handle KeyboardInterrupt & SystemExit correctly

Such exceptions need to be handled separately when catching the generic
Exception class under Python 2.4 or they get gobbled up by the generic exception
handling.
This commit is contained in:
Jurko Gospodnetić 2014-04-27 01:26:40 +02:00
parent ac23dfbbd7
commit 96ae433af8
1 changed files with 6 additions and 0 deletions

View File

@ -184,6 +184,8 @@ def has_powershell():
try:
try:
subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
except (KeyboardInterrupt, SystemExit):
raise
except Exception:
return False
finally:
@ -202,6 +204,8 @@ def has_curl():
try:
try:
subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
except (KeyboardInterrupt, SystemExit):
raise
except Exception:
return False
finally:
@ -220,6 +224,8 @@ def has_wget():
try:
try:
subprocess.check_call(cmd, stdout=devnull, stderr=devnull)
except (KeyboardInterrupt, SystemExit):
raise
except Exception:
return False
finally: