summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJensDiemer <git@jensdiemer.de>2014-09-14 21:40:05 +0200
committerJensDiemer <git@jensdiemer.de>2014-09-14 21:40:05 +0200
commit0667e8f998be5d55b4578461119ee00910e1544c (patch)
tree1b69b97c62814bf3afc2c7f9bfe73c559dac7353
parentbdb16dcf3471831ae252006f8d7fcecd2e537154 (diff)
downloadcreole-0667e8f998be5d55b4578461119ee00910e1544c.tar.gz
Bugfix: urlparse import error
-rw-r--r--creole/rest2html/pypi_rest2html.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/creole/rest2html/pypi_rest2html.py b/creole/rest2html/pypi_rest2html.py
index 62fca41..15b425c 100644
--- a/creole/rest2html/pypi_rest2html.py
+++ b/creole/rest2html/pypi_rest2html.py
@@ -13,7 +13,12 @@
from __future__ import division, absolute_import, print_function
-import urlparse
+try:
+ # Python 3
+ from urllib.parse import urlparse
+except ImportError:
+ # Python 2
+ from urlparse import urlparse
from creole.exceptions import DocutilsImportError
@@ -61,7 +66,7 @@ def pypi_rest2html(source, output_encoding='unicode'):
uri = node['uri']
else:
continue
- o = urlparse.urlparse(uri)
+ o = urlparse(uri)
if o.scheme not in ALLOWED_SCHEMES:
raise TransformError('link scheme not allowed')