From 52b6857f93805f37cf69769d9d9d8242001c8ec9 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 30 Jun 2008 11:56:52 +0000 Subject: [PATCH] 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 --- django/db/transaction.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/db/transaction.py b/django/db/transaction.py index c0c3779f6a..cd27cf6044 100644 --- a/django/db/transaction.py +++ b/django/db/transaction.py @@ -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