diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-06-30 11:56:52 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-06-30 11:56:52 +0000 |
| commit | 52b6857f93805f37cf69769d9d9d8242001c8ec9 (patch) | |
| tree | b9e39d3d8d21458b14ad010d4f1295cdf5dcf9e0 | |
| parent | 5f7bb13f272952df2d38afe1706ac7dc2d6ca6a1 (diff) | |
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
| -rw-r--r-- | django/db/transaction.py | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
