From 96ae433af8766dd2f61f93fdf8736a0097f7c5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sun, 27 Apr 2014 01:26:40 +0200 Subject: [PATCH] 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. --- ez_setup_1_4_2.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ez_setup_1_4_2.py b/ez_setup_1_4_2.py index 4da6781..ba4c246 100644 --- a/ez_setup_1_4_2.py +++ b/ez_setup_1_4_2.py @@ -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: