Ticket #9528: oracle_attribute_error.diff

File oracle_attribute_error.diff, 812 bytes (added by erny, 16 years ago)

Patch for "AttributeError: DatabaseError instance has no attribute 'message'"

  • django/db/backends/oracle/base.py

     
    361361            return Database.Cursor.execute(self, query, self._param_generator(params))
    362362        except DatabaseError, e:
    363363            # cx_Oracle <= 4.4.0 wrongly raises a DatabaseError for ORA-01400.
    364             if e.args[0].code == 1400 and not isinstance(e, IntegrityError):
    365                 e = IntegrityError(e.args[0])
     364            if hasattr(e, 'message'):
     365                if e.args[0].code == 1400 and not isinstance(e, IntegrityError):
     366                    e = IntegrityError(e.args[0])
    366367            raise e
    367368
    368369    def executemany(self, query, params=None):
Back to Top