summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2021-06-18 14:35:18 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-18 22:38:05 +0000
commitf1dad7730feb3e0a8ab37651e11fd3aad1b74938 (patch)
tree959e0bc1b84e764d93e030d43a97b5dbcd360746
parent90120a2e36936e9e857ee84e799657d5e54b7ba0 (diff)
downloadchrome-ec-f1dad7730feb3e0a8ab37651e11fd3aad1b74938.tar.gz
test: port to Python3
Porting consisted of running 2to3 and then modifying the Tee::write() function by hand. BUG=none TEST='make -j buildall' does not throw Python2 warnings any more and still succeeds. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I6762bfc176ef749dccba7572db171dd2f83aaebc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2973575 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
-rwxr-xr-xutil/run_host_test6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/run_host_test b/util/run_host_test
index db3345845d..6d0c1adb5e 100755
--- a/util/run_host_test
+++ b/util/run_host_test
@@ -1,10 +1,10 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
# Copyright 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from cStringIO import StringIO
+from io import StringIO
import os
import pexpect
import signal
@@ -28,6 +28,8 @@ class Tee(object):
self._target = target
def write(self, data):
+ if isinstance(data, bytes):
+ data = data.decode('utf-8')
sys.stdout.write(data)
self._target.write(data)