| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Django
Revision: 8965
Author: mboersma
Date: 04 Sep 2008 12:41:59
Diff at Trac: http://code.djangoproject.com/changeset/8965
Changes:Fixed re-raising of ORA-01400 as an IntegrityError in a way that works on Python 2.3 and 2.4 as well.
Files:| ... | ...@@ -361,8 +361,8 @@ | |
| 361 | 361 | return Database.Cursor.execute(self, query, self._param_generator(params)) |
| 362 | 362 | except DatabaseError, e: |
| 363 | 363 | # cx_Oracle <= 4.4.0 wrongly raises a DatabaseError for ORA-01400. |
| 364 | if e.message.code == 1400 and type(e) != IntegrityError: | |
| 365 | e = IntegrityError(e.message) | |
| 364 | if e.args[0].code == 1400 and not isinstance(e, IntegrityError): | |
| 365 | e = IntegrityError(e.args[0]) | |
| 366 | 366 | raise e |
| 367 | 367 | |
| 368 | 368 | def executemany(self, query, params=None): |
| ... | ...@@ -384,8 +384,8 @@ | |
| 384 | 384 | return Database.Cursor.executemany(self, query, [self._param_generator(p) for p in formatted]) |
| 385 | 385 | except DatabaseError, e: |
| 386 | 386 | # cx_Oracle <= 4.4.0 wrongly raises a DatabaseError for ORA-01400. |
| 387 | if e.message.code == 1400 and type(e) != IntegrityError: | |
| 388 | e = IntegrityError(e.message) | |
| 387 | if e.args[0].code == 1400 and not isinstance(e, IntegrityError): | |
| 388 | e = IntegrityError(e.args[0]) | |
| 389 | 389 | raise e |
| 390 | 390 | |
| 391 | 391 | def fetchone(self): |