X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/357027375ff8867f42ca34bcbfb5a78b5b185fc3..084f20588e607aa9ae3ed280b6a2f0349b6a3200:/src/stats/tasks.py diff --git a/src/stats/tasks.py b/src/stats/tasks.py index dcd0a4bd7..cb2ec8363 100644 --- a/src/stats/tasks.py +++ b/src/stats/tasks.py @@ -4,9 +4,9 @@ # from celery.task import task from django.conf import settings -import httplib +from http.client import HTTPConnection import logging -import urlparse +from urllib.parse import urlsplit logger = logging.getLogger(__name__) @@ -15,7 +15,7 @@ PIWIK_API_VERSION = 1 # Retrieve piwik information try: - _host = urlparse.urlsplit(settings.PIWIK_URL).netloc + _host = urlsplit(settings.PIWIK_URL).netloc except AttributeError: logger.debug("PIWIK_URL not configured.") _host = None @@ -24,6 +24,6 @@ except AttributeError: @task(ignore_result=True) def track_request(piwik_args): piwik_url = "%s%s%s" % (settings.PIWIK_URL, u"/piwik.php?", piwik_args) - conn = httplib.HTTPConnection(_host) + conn = HTTPConnection(_host) conn.request('GET', piwik_url) conn.close()