From 7a0a3a64a827480c737060bcd5af9af25c3b3c15 Mon Sep 17 00:00:00 2001 From: Krzysztof Jurewicz Date: Mon, 25 Nov 2013 15:39:19 +0100 Subject: [PATCH] Fixed #21509 -- Removed dead exception catching code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since Python 2.5, KeyboardInterrupt and SystemExit are not subclasses of Exception, so explicitly reraising them before the “except Exception” clause is not necessary anymore. --- django/test/testcases.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/django/test/testcases.py b/django/test/testcases.py index 9598bd182a..bb40e5c4fd 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -175,8 +175,6 @@ class SimpleTestCase(unittest.TestCase): if not skipped: try: self._pre_setup() - except (KeyboardInterrupt, SystemExit): - raise except Exception: result.addError(self, sys.exc_info()) return @@ -184,8 +182,6 @@ class SimpleTestCase(unittest.TestCase): if not skipped: try: self._post_teardown() - except (KeyboardInterrupt, SystemExit): - raise except Exception: result.addError(self, sys.exc_info()) return