From 558a0b5c7110dd9ec38791cba9ffd1bcdca2aeea Mon Sep 17 00:00:00 2001 From: Sun Austin Date: Wed, 16 Jan 2019 10:17:36 +0800 Subject: [PATCH] Fix AttributeError: 'str' object has no attribute 'decode' for python3 Story: 2003433 Task: 28928 Change-Id: I4c601a72232402e45fe70e0d29de031ff294a4d7 Signed-off-by: Sun Austin --- fm-api/fm_api/fm_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fm-api/fm_api/fm_api.py b/fm-api/fm_api/fm_api.py index c5bddb08..321fd267 100755 --- a/fm-api/fm_api/fm_api.py +++ b/fm-api/fm_api/fm_api.py @@ -64,7 +64,7 @@ class Fault(object): @staticmethod def _unicode(value): - if isinstance(value, str): + if six.PY2 and isinstance(value, str): return six.text_type(value.decode('utf-8')) else: return value