summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-17 00:07:06 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-08-17 00:07:06 +0000
commit260510453f25c0ab00254a9efdd7bea35ecdcee6 (patch)
tree165a39fef61565590b8793b7690c180eb460751c
parent2d2396a3841d56243e9caab39fdb57dead17f5c4 (diff)
Fixed #7241 -- More robust exception catching in the transaction management
code. As pointed out in the ticket, Python still lets you raise all sorts of odd things as exceptions (e.g. strings), so even though they're bad form, we should still handle them. We do that cleanly now. Thanks to jim-django@dsdd.org for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8419 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/transaction.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/django/db/transaction.py b/django/db/transaction.py
index e5e8890ee7..506074f1b3 100644
--- a/django/db/transaction.py
+++ b/django/db/transaction.py
@@ -236,10 +236,8 @@ def commit_on_success(func):
managed(True)
try:
res = func(*args, **kw)
- except (Exception, KeyboardInterrupt, SystemExit):
- # (We handle KeyboardInterrupt and SystemExit specially, since
- # they don't inherit from Exception in Python 2.5, but we
- # should treat them uniformly here.)
+ except:
+ # All exceptions must be handled here (even string ones).
if is_dirty():
rollback()
raise