Kaydet (Commit) 7a0a3a64 authored tarafından Krzysztof Jurewicz's avatar Krzysztof Jurewicz Kaydeden (comit) Baptiste Mispelon

Fixed #21509 -- Removed dead exception catching code.

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.
üst 7349a22d
...@@ -175,8 +175,6 @@ class SimpleTestCase(unittest.TestCase): ...@@ -175,8 +175,6 @@ class SimpleTestCase(unittest.TestCase):
if not skipped: if not skipped:
try: try:
self._pre_setup() self._pre_setup()
except (KeyboardInterrupt, SystemExit):
raise
except Exception: except Exception:
result.addError(self, sys.exc_info()) result.addError(self, sys.exc_info())
return return
...@@ -184,8 +182,6 @@ class SimpleTestCase(unittest.TestCase): ...@@ -184,8 +182,6 @@ class SimpleTestCase(unittest.TestCase):
if not skipped: if not skipped:
try: try:
self._post_teardown() self._post_teardown()
except (KeyboardInterrupt, SystemExit):
raise
except Exception: except Exception:
result.addError(self, sys.exc_info()) result.addError(self, sys.exc_info())
return return
......
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