From 2525bb98d17c239e45342e4191bd946e74484a9e Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Mon, 28 Sep 2015 10:56:05 +0200 Subject: Make urlparse import Python3-compatible urlparse moved to urllib.parse, so the current code fails in Python3. Using six to ensure compatibility. Related-Bug: #1426898 Change-Id: I9297c886dcc361238e942cb8162f589072001094 --- oslosphinx/__init__.py | 4 ++-- requirements.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/oslosphinx/__init__.py b/oslosphinx/__init__.py index d31e81d..f788147 100644 --- a/oslosphinx/__init__.py +++ b/oslosphinx/__init__.py @@ -13,8 +13,8 @@ # under the License. import os +from six.moves.urllib import parse import subprocess -import urlparse CGIT_BASE = 'http://git.openstack.org/cgit/' @@ -31,7 +31,7 @@ def _html_page_context(app, pagename, templatename, context, doctree): except subprocess.CalledProcessError: _cgit_link = 'unknown' else: - parsed = urlparse.urlparse(git_remote) + parsed = parse.urlparse(git_remote) _cgit_link = CGIT_BASE + parsed.path.lstrip('/') context['cgit_link'] = _cgit_link return context diff --git a/requirements.txt b/requirements.txt index 44da7c5..ac98e29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ pbr>=1.6 requests>=2.5.2 +six>=1.9.0 -- cgit v1.2.1