From 8610869a38a1525aee8f60d5189598fc8ed57086 Mon Sep 17 00:00:00 2001 From: Tim Van Patten Date: Wed, 19 Jun 2019 09:49:56 -0600 Subject: [PATCH] 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 --- scripts/android/install_apk.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.7.4