diff options
author | liyou01 <liyou01@inspur.com> | 2021-01-07 15:57:43 +0800 |
---|---|---|
committer | Cyril Roelandt <cyril@redhat.com> | 2022-05-25 04:42:06 +0200 |
commit | 5ff06df97fbd78f6781793c35801a4c989a515f1 (patch) | |
tree | e81f73b2d062ebccd0a3ed8e8ab20f545dffca5c /glance_store/exceptions.py | |
parent | aeee48b561ba0d100663311c3ba94f0d128105aa (diff) | |
download | glance_store-5ff06df97fbd78f6781793c35801a4c989a515f1.tar.gz |
Remove Python 2 support
Python 2 has been deprecated for almost two years, and has not been
guaranteed to work with glance_store for a while. This patch removes all
traces of six, unicode strings and Python 2 tweaks.
Co-Authored-By: Cyril Roelandt <cyril@redhat.com>
Change-Id: Ifa78924d7ecf4f2d9a54c677888ab2926530c487
Diffstat (limited to 'glance_store/exceptions.py')
-rw-r--r-- | glance_store/exceptions.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/glance_store/exceptions.py b/glance_store/exceptions.py index 99bc1b0..448e754 100644 --- a/glance_store/exceptions.py +++ b/glance_store/exceptions.py @@ -15,8 +15,7 @@ """Glance Store exception subclasses""" -import six -import six.moves.urllib.parse as urlparse +import urllib.parse from glance_store.i18n import _ @@ -31,7 +30,7 @@ class UnsupportedBackend(BackendException): class RedirectException(Exception): def __init__(self, url): - self.url = urlparse.urlparse(url) + self.url = urllib.parse.urlparse(url) class GlanceStoreException(Exception): @@ -55,12 +54,6 @@ class GlanceStoreException(Exception): self.msg = message super(GlanceStoreException, self).__init__(message) - def __unicode__(self): - # NOTE(flwang): By default, self.msg is an instance of Message, which - # can't be converted by str(). Based on the definition of - # __unicode__, it should return unicode always. - return six.text_type(self.msg) - class MissingCredentialError(GlanceStoreException): message = _("Missing required credential: %(required)s") |