summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Pena <jpena@redhat.com>2015-09-28 10:56:05 +0200
committerJavier Pena <jpena@redhat.com>2015-09-28 11:34:24 +0200
commit2525bb98d17c239e45342e4191bd946e74484a9e (patch)
treee5ca8f4b6f66dc7e5e334a225479c3f02905a680
parentb0f3ed9cca78e9239ffd779906ffbae89c3dab6a (diff)
downloadoslosphinx-2525bb98d17c239e45342e4191bd946e74484a9e.tar.gz
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
-rw-r--r--oslosphinx/__init__.py4
-rw-r--r--requirements.txt1
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