Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jaydebeapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ def _handle_sql_exception_jpype():
import jpype
SQLException = jpype.java.sql.SQLException
exc_info = sys.exc_info()
if issubclass(exc_info[1].__javaclass__, SQLException):
if old_jpype:
clazz = exc_info[1].__javaclass__
db_err = issubclass(clazz, SQLException)
else:
exc = exc_info[1]
db_err = isinstance(exc, SQLException)
if db_err:
exc_type = DatabaseError
else:
exc_type = InterfaceError
Expand Down