changeset 117:6cb762107214

py3
author Jeff Hammel <k0scist@gmail.com>
date Tue, 03 Nov 2020 14:16:39 -0800
parents 8a3b8fee1df2
children e81b431daf37
files bitsyblog/bitsyblog.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/bitsyblog.py	Tue Nov 03 14:14:29 2020 -0800
+++ b/bitsyblog/bitsyblog.py	Tue Nov 03 14:16:39 2020 -0800
@@ -25,9 +25,15 @@
 from paste.fileapp import FileApp
 from pkg_resources import iter_entry_points
 from pkg_resources import resource_filename
-from urlparse import urlparse
 from webob import Request, Response, exc
 
+try:
+    # python2
+    from urlparse import urlparse
+except ImportError:
+    # python3
+    from urllib.parse import urlparse
+
 
 class BlogPathException(Exception):
     """exception when trying to retrieve the blog"""