Skip to content

Commit

Permalink
[jdbc] Remove Py2 syntax (#3594)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshg999 authored Jan 3, 2024
1 parent 94fddd7 commit 5515907
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions desktop/libs/notebook/src/notebook/connectors/jdbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
from librdbms.jdbc import Jdbc, query_and_fetch

from notebook.connectors.base import Api, QueryError, AuthenticationRequired, _get_snippet_name

if sys.version_info[0] > 2:
from django.utils.translation import gettext as _
else:
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

LOG = logging.getLogger()

Expand All @@ -45,10 +41,7 @@ def decorator(*args, **kwargs):
except Exception as e:
message = force_unicode(smart_str(e))
if 'error occurred while trying to connect to the Java server' in message:
if sys.version_info[0] > 2:
raise QueryError(_('%s: is the DB Proxy server running?') % message).with_traceback(sys.exc_info()[2])
else:
raise QueryError, _('%s: is the DB Proxy server running?') % message, sys.exc_info()[2]
raise QueryError(_('%s: is the DB Proxy server running?') % message).with_traceback(sys.exc_info()[2])
elif 'Access denied' in message:
raise AuthenticationRequired('').with_traceback(sys.exc_info()[2])
else:
Expand Down

0 comments on commit 5515907

Please sign in to comment.