aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar cclauss <cclauss@bluewin.ch>2018-03-08 08:25:05 +0100
committerGravatar Gunhan Gulsoy <gunan@google.com>2018-03-07 23:25:05 -0800
commit9cd677c093315294eb1aa79472422616e04e63b9 (patch)
tree69bb007fda66a1f38007144166cfdc1284ca8248
parent74fc896ff4e78d0bfad810e0716cf78845bae36c (diff)
Change unicode() --> six.text_type() for Python 3 (#17225)
__unicode()__ was removed in Python 3 because all str are Unicode so this PR changes four calls to __unicode()__ into calls to [__six.text_type()__](http://six.readthedocs.io/#six.text_type).
-rw-r--r--tensorflow/tools/test/upload_test_benchmarks.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tensorflow/tools/test/upload_test_benchmarks.py b/tensorflow/tools/test/upload_test_benchmarks.py
index 77cc9f75f7..edd093510e 100644
--- a/tensorflow/tools/test/upload_test_benchmarks.py
+++ b/tensorflow/tools/test/upload_test_benchmarks.py
@@ -88,6 +88,7 @@ import os
import shutil
from google.cloud import datastore
+from six import text_type
def is_real_file(dirpath, fname):
@@ -150,7 +151,7 @@ def upload_benchmark_data(client, data):
"""
test_result = json.loads(data)
- test_name = unicode(test_result["name"])
+ test_name = text_type(test_result["name"])
start_time = datetime.datetime.utcfromtimestamp(
float(test_result["startTime"]))
batch = []
@@ -162,7 +163,7 @@ def upload_benchmark_data(client, data):
t_val.update({
"test": test_name,
"start": start_time,
- "info": unicode(data)
+ "info": text_type(data)
})
batch.append(t_val)
@@ -170,7 +171,7 @@ def upload_benchmark_data(client, data):
# the attribute to be fetched and displayed. The full entry information is
# also stored as a non-indexed JSON blob.
for ent in test_result["entries"].get("entry", []):
- ent_name = unicode(ent["name"])
+ ent_name = text_type(ent["name"])
e_key = client.key("Entry")
e_val = datastore.Entity(e_key, exclude_from_indexes=["info"])
e_val.update({
@@ -178,7 +179,7 @@ def upload_benchmark_data(client, data):
"start": start_time,
"entry": ent_name,
"timing": ent["wallTime"],
- "info": unicode(json.dumps(ent))
+ "info": text_type(json.dumps(ent))
})
batch.append(e_val)