From 244e02c3d5361ba5163f0ab27a52bea99ecb6bec Mon Sep 17 00:00:00 2001 From: chenke Date: Thu, 16 Apr 2020 16:04:32 +0800 Subject: [PATCH] Remove six[3] Change-Id: I92535c69f7055a7431ff14d3b9722149950e7f91 --- watcher/common/exception.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/watcher/common/exception.py b/watcher/common/exception.py index 1fbc5f5e3..86ce9f4cc 100644 --- a/watcher/common/exception.py +++ b/watcher/common/exception.py @@ -28,7 +28,6 @@ import sys from keystoneclient import exceptions as keystone_exceptions from oslo_config import cfg from oslo_log import log -import six from watcher._i18n import _ @@ -97,19 +96,16 @@ class WatcherException(Exception): def __str__(self): """Encode to utf-8 then wsme api can consume it as well""" - if not six.PY3: - return six.text_type(self.args[0]).encode('utf-8') - else: - return self.args[0] + return self.args[0] def __unicode__(self): - return six.text_type(self.args[0]) + return str(self.args[0]) def format_message(self): if self.__class__.__name__.endswith('_Remote'): return self.args[0] else: - return six.text_type(self) + return str(self) class UnsupportedError(WatcherException):