Fix Jython handling of Java exceptions that don't subclass python Exception

This commit is contained in:
baztian
2014-02-12 23:49:54 +01:00
parent 9d4a24e919
commit b538a14849
+6 -3
View File
@@ -350,13 +350,15 @@ class Connection(object):
def commit(self):
try:
self.jconn.commit()
except Exception, ex:
except:
ex = sys.exc_info()[1]
_handle_sql_exception(ex)
def rollback(self):
try:
self.jconn.rollback()
except Exception, ex:
except:
ex = sys.exc_info()[1]
_handle_sql_exception(ex)
def cursor(self):
@@ -440,7 +442,8 @@ class Cursor(object):
self._set_stmt_parms(self._prep, parameters)
try:
is_rs = self._prep.execute()
except Exception, ex:
except:
ex = sys.exc_info()[1]
_handle_sql_exception(ex)
if is_rs:
self._rs = self._prep.getResultSet()