From a0a53eace2efd3e07cb584cd6f360058bb4dce17 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Tue, 30 Aug 2016 16:42:42 -0700 Subject: python3 support --- test/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/utils.py') diff --git a/test/utils.py b/test/utils.py index a9c8dce4..97d915ce 100644 --- a/test/utils.py +++ b/test/utils.py @@ -15,6 +15,7 @@ # limitations under the License. # +from __future__ import print_function import contextlib import os import shutil @@ -47,7 +48,7 @@ class Executable(object): cmd = [self.exe] + self.before_args + list(args) + self.after_args cmd_str = ' '.join(cmd) if self.verbose: - print cmd_str + print(cmd_str) err_cmd_str = cmd_str.replace('.exe', '') if not self.error_cmdline: @@ -61,6 +62,8 @@ class Executable(object): stderr=subprocess.PIPE, **kwargs) stdout, stderr = process.communicate() + stdout = stdout.decode('ascii') + stderr = stderr.decode('ascii') if self.clean_stdout: stdout = self.clean_stdout(stdout) if self.clean_stderr: @@ -92,7 +95,7 @@ class Executable(object): self.after_args.append(arg) def AppendOptionalArgs(self, option_dict): - for option, value in option_dict.iteritems(): + for option, value in option_dict.items(): if value: self.AppendArg(option) -- cgit v1.2.3