Browse files

Fixed #7241 -- More robust exception catching in the transaction mana…


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
for the patch.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 2d2396a commit 260510453f25c0ab00254a9efdd7bea35ecdcee6 @malcolmt malcolmt committed Aug 17, 2008
Showing with 2 additions and 4 deletions.
  1. +2 −4 django/db/
@@ -236,10 +236,8 @@ def _commit_on_success(*args, **kw):
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():

0 comments on commit 2605104

Please sign in to comment.