diff --git a/kinto/core/statsd.py b/kinto/core/statsd.py index 802663755..5ab226e04 100644 --- a/kinto/core/statsd.py +++ b/kinto/core/statsd.py @@ -7,7 +7,7 @@ statsd_module = None from pyramid.exceptions import ConfigurationError -import urlparse +from urllib.parse import urlparse from kinto.core import utils @@ -53,7 +53,7 @@ def load_from_config(config): settings = config.get_settings() uri = settings['statsd_url'] - uri = urlparse.urlparse(uri) + uri = urlparse(uri) if settings['project_name'] != '': prefix = settings['project_name'] diff --git a/kinto/core/utils.py b/kinto/core/utils.py index 4a6be880a..4c94d90c4 100644 --- a/kinto/core/utils.py +++ b/kinto/core/utils.py @@ -8,7 +8,7 @@ import time from base64 import b64decode, b64encode from binascii import hexlify -import urlparse +from urllib.parse import unquote from enum import Enum import ujson as json # NOQA @@ -343,7 +343,7 @@ def build_response(response, request): :param request: the request that was used to get the response. """ dict_obj = {} - dict_obj['path'] = urlparse.unquote(request.path) + dict_obj['path'] = unquote(request.path) dict_obj['status'] = response.status_code dict_obj['headers'] = dict(response.headers) diff --git a/tests/core/resource/test_pagination.py b/tests/core/resource/test_pagination.py index 3485e715b..da3498c30 100644 --- a/tests/core/resource/test_pagination.py +++ b/tests/core/resource/test_pagination.py @@ -2,7 +2,7 @@ from base64 import b64encode, b64decode import mock -from urlparse import parse_qs, urlparse +from urllib.parse import parse_qs, urlparse from pyramid.httpexceptions import HTTPBadRequest from kinto.core.utils import json