diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-08-10 04:45:10 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-08-10 04:45:10 +0000 |
| commit | 024e68e260a70281d6f07e3a562e24140d3ecc2f (patch) | |
| tree | c8b8d76dedfe2f132859dd64fff9b5da2cc0d45d | |
| parent | 0660203afe66fbc663a4e0af93ec74cd61e2c712 (diff) | |
Changed MySQL backend so that it fails silently if rollback() isn't supported (the code catches NotSupportedError exception)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@459 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/db/backends/mysql.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/core/db/backends/mysql.py b/django/core/db/backends/mysql.py index 886a0a38b8..939d3c2df7 100644 --- a/django/core/db/backends/mysql.py +++ b/django/core/db/backends/mysql.py @@ -9,6 +9,7 @@ from django.core.db.dicthelpers import * import MySQLdb as Database from MySQLdb.converters import conversions from MySQLdb.constants import FIELD_TYPE +from _mysql_exceptions import NotSupportedError import types DatabaseError = Database.DatabaseError @@ -40,7 +41,10 @@ class DatabaseWrapper: def rollback(self): if self.connection: - self.connection.rollback() + try: + self.connection.rollback() + except NotSupportedError: + pass def close(self): if self.connection is not None: |
