From 83ad2e8ade5dceaec466d2f7f4d5545cee6ba79a Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Fri, 2 Feb 2018 16:37:50 -0800 Subject: [PATCH] Convert unicode to six.string_types for python 3 (#16676) In Python 3, there is no unicode type. This fix converts unicode to use six.string_types instead, while maintaining python 2/3 compatibility. Signed-off-by: Yong Tang --- tensorflow/contrib/learn/python/learn/monitors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/contrib/learn/python/learn/monitors.py b/tensorflow/contrib/learn/python/learn/monitors.py index 0948dee..51381a7 100644 --- a/tensorflow/contrib/learn/python/learn/monitors.py +++ b/tensorflow/contrib/learn/python/learn/monitors.py @@ -879,7 +879,7 @@ class GraphDump(BaseMonitor): this_output = self.data[step] if step in self.data else {} other_output = other_dump.data[step] if step in other_dump.data else {} for key in this_output: - if not isinstance(key, str) and not isinstance(key, unicode): + if not isinstance(key, six.string_types): continue if key not in other_output: raise ValueError("%s missing at step %s.", (key, step)) -- 2.7.4