From 4c3639631207043e0c2ceb016c11c9323cbd3711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20HUBSCHER?= Date: Mon, 30 Jan 2017 18:50:24 +0100 Subject: [PATCH] Fix urlparse imports. --- kinto/core/statsd.py | 4 ++-- kinto/core/utils.py | 4 ++-- tests/core/resource/test_pagination.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kinto/core/statsd.py b/kinto/core/statsd.py index 8026637551..5ab226e04f 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 4a6be880ae..4c94d90c43 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 3485e715b9..da3498c30f 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