Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions indexdigest/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def query(self, sql, cursor_class=None):
cursor = self.connection.cursor(cursorclass=cursor_class)

try:
# Python 2: query should be bytes when executing %.
# Python 3: query should be str (unicode) when executing %
try:
sql = sql.encode('utf8')
Expand All @@ -106,7 +105,7 @@ def query(self, sql, cursor_class=None):
# e.g. (1146, "Table 'index_digest.t' doesn't exist") - ProgrammingError
(code, message) = ex.args
self.query_logger.error('Database error #%d: %s', code, message)
raise IndexDigestQueryError(message)
raise IndexDigestQueryError(message) from ex

# register the query
self._queries.append(sql)
Expand Down
5 changes: 1 addition & 4 deletions indexdigest/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
"""
This module contains utility functions and classes
"""
try:
from urlparse import urlparse # Python2
except ImportError:
from urllib.parse import urlparse # Python3
from urllib.parse import urlparse

import functools
import logging
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
packages=find_packages(),
extras_require={
'dev': [
'coverage==5.2.1',
'pylint>=2.4.2',
'pylint==2.6.0',
'pytest==6.0.1',
'twine==3.2.0',
]
Expand All @@ -53,7 +55,7 @@
'docopt==0.6.2',
'PyYAML==5.3.1',
'mysqlclient==2.0.1',
'sql_metadata==1.7.1',
'sql_metadata==1.8.0',
'termcolor==1.1.0',
'yamlordereddictloader==0.4.0'
],
Expand Down