From 1563c9166909d8f635f73a5a82f1c96ea45a60e4 Mon Sep 17 00:00:00 2001 From: Zifei Tong <zifeitong@gmail.com> Date: Wed, 26 Mar 2014 19:03:12 +0800 Subject: [PATCH] scripts: make 'scripts/test.py' support Python3 Python3 no longer allow implicitly conversion form bytes to string, add explicit decode() to convert input bytes. Tested with both Python2 and Python3. Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by: Zifei Tong <zifeitong@gmail.com> Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com> --- scripts/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test.py b/scripts/test.py index e3d9ab695..ff32ca3f7 100755 --- a/scripts/test.py +++ b/scripts/test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import subprocess import argparse import glob @@ -72,7 +72,7 @@ def run_test(test): out = "" line = "" while True: - ch = process.stdout.read(1) + ch = process.stdout.read(1).decode() if ch == '' and process.poll() != None: break out += ch -- GitLab