Remove six[3]

Change-Id: I92535c69f7055a7431ff14d3b9722149950e7f91
This commit is contained in:
chenke
2020-04-16 16:04:32 +08:00
parent de9d250537
commit 244e02c3d5

View File

@@ -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):