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:
Malcolm Tredinnick 2008-06-30 11:56:52 +00:00
parent 5f7bb13f27
commit 52b6857f93
1 changed files with 4 additions and 1 deletions

View File

@ -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