Fixed #6928 -- Added a little more robustness to transaction rollbacks for Python 2.5. Patch from guettli.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5f7bb13f27
commit
52b6857f93
|
@ -196,7 +196,10 @@ def commit_on_success(func):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue