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)
|
managed(True)
|
||||||
try:
|
try:
|
||||||
res = func(*args, **kw)
|
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():
|
if is_dirty():
|
||||||
rollback()
|
rollback()
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue