From 33874f09cdd40ff6214b534cf9eee5d65c056f7a Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 27 Jan 2022 16:33:07 +0000 Subject: [PATCH] Remove '__unicode__' magic methods These don't do anything in Python 3. We should use '__str__' instead. Change-Id: I3c06744a1de4a65b97556665040bcaa347cdb76b Signed-off-by: Stephen Finucane --- glance/common/exception.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/glance/common/exception.py b/glance/common/exception.py index 76c6fdb734..1fde477b86 100644 --- a/glance/common/exception.py +++ b/glance/common/exception.py @@ -53,12 +53,6 @@ class GlanceException(Exception): self.msg = message super(GlanceException, 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 str(self.msg) - class MissingCredentialError(GlanceException): message = _("Missing required credential: %(required)s")