Permalink
Browse files

Python 2.5- support

  • Loading branch information...
1 parent 1d35c1e commit cae457494dc2f7c3ffeb5721b9c915a6c64603eb @nakagami committed Apr 22, 2011
Showing with 6 additions and 4 deletions.
  1. +4 −3 firebirdsql/fbcore.py
  2. +2 −1 firebirdsql/tests.py
View
@@ -631,9 +631,10 @@ def execute(self, query, params = []):
self.connection._op_execute(self.stmt_handle, params)
try:
(h, oid, buf) = self.connection._op_response()
- except OperationalError as o:
- if 335544665 in o.gds_codes:
- raise IntegrityError(o.message, o.gds_codes, o.sql_code)
+ except OperationalError:
+ e = sys.exc_info()[1]
+ if 335544665 in e.gds_codes:
+ raise IntegrityError(e.message, e.gds_codes, e.sql_code)
self.rows = None
def executemany(self, query, seq_of_params):
View
@@ -67,7 +67,8 @@ def debug_print(msg):
pass
try:
conn.cursor().execute("bad sql")
- except firebirdsql.OperationalError as e:
+ except firebirdsql.OperationalError:
+ e = sys.exc_info()[1]
assert e.sql_code == -104
cur = conn.cursor()

0 comments on commit cae4574

Please sign in to comment.