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.
This commit is contained in:
parent
7349a22d29
commit
7a0a3a64a8
|
@ -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):
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue