From 6858bacd41b81da8a369ecdd6281b5e3973b1aed Mon Sep 17 00:00:00 2001 From: Ricter Z Date: Mon, 17 Oct 2016 21:50:07 +0800 Subject: [PATCH] urlparse for python3 --- nhentai/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nhentai/utils.py b/nhentai/utils.py index 794efad..abcdaa7 100644 --- a/nhentai/utils.py +++ b/nhentai/utils.py @@ -1,6 +1,5 @@ # coding: utf-8 - class _Singleton(type): """ A metaclass that creates a Singleton base class when called. """ _instances = {} @@ -17,6 +16,8 @@ class Singleton(_Singleton('SingletonMeta', (object,), {})): def urlparse(url): try: - import urlparse + from urlparse import urlparse except ImportError: import urllib.parse as urlparse + + return urlparse(url)