Skip to content

Commit

Permalink
Fixed #6928 -- Added a little more robustness to transaction rollback…
Browse files Browse the repository at this point in the history
…s for Python 2.5. Patch from guettli.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Jun 30, 2008
1 parent 5f7bb13 commit 52b6857
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/db/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ def _commit_on_success(*args, **kw):
managed(True)
try:
res = func(*args, **kw)
except Exception, e:
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.)
if is_dirty():
rollback()
raise
Expand Down

0 comments on commit 52b6857

Please sign in to comment.