From: Tim Van Patten Date: Wed, 19 Jun 2019 15:49:56 +0000 (-0600) Subject: Fix install_apk.py Python 3 migration X-Git-Tag: upstream/1.3.5~2019 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8610869a38a1525aee8f60d5189598fc8ed57086;p=platform%2Fupstream%2FVK-GL-CTS.git Fix install_apk.py Python 3 migration The current install_apk.py hits errors with Python3 which this attempts to address. VK-GL-CTS issue: 1665 Change-Id: I38cb2ffc991f19a8cb95cef4d102a968c4a78bf2 --- diff --git a/scripts/android/install_apk.py b/scripts/android/install_apk.py index 6f5b14b..51fe65c 100644 --- a/scripts/android/install_apk.py +++ b/scripts/android/install_apk.py @@ -61,7 +61,7 @@ def getDevices (adbPath): if len(line.strip()) == 0: continue - m = ptrn.match(line) + m = ptrn.match(line.decode('utf-8')) if m == None: print("WARNING: Failed to parse device info '%s'" % line) continue @@ -77,7 +77,7 @@ def execWithPrintPrefix (args, linePrefix="", failOnNonZeroExit=True): line = source.readline() if len(line) == 0: # EOF break; - sink.write(prefix + line) + sink.write(prefix + line.decode('utf-8')) process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdoutJob = threading.Thread(target=readApplyPrefixAndPrint, args=(process.stdout, linePrefix, sys.stdout)) @@ -233,7 +233,7 @@ if __name__ == "__main__": for i in range(0, len(devices)): print("%3d: %16s %s" % ((i+1), devices[i].serial, devices[i].model)) - deviceNdx = int(raw_input("Choose device (1-%d): " % len(devices))) + deviceNdx = int(input("Choose device (1-%d): " % len(devices))) installToDevice(devices[deviceNdx-1], args.adbPath, packageName, apkPath) else: devices = getDevices(args.adbPath)