Python3 compatibility: Fix build_apk.py
authorBoris Zanin <boris.zanin@mobica.com>
Mon, 3 Jun 2019 12:14:17 +0000 (14:14 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 5 Jun 2019 07:27:59 +0000 (03:27 -0400)
The files build_apk need to be updated ti run under Python 3.

Components: Framework

VK-GL-CTS issue: 1665

Change-Id: I0c21e7114f2f4d55ebf31353c270cadfbe98dd96

scripts/android/build_apk.py

index 7d4a258..630cd41 100644 (file)
@@ -113,7 +113,7 @@ class NDKEnv:
                try:
                        with open(propFilePath) as propFile:
                                for line in propFile:
-                                       keyValue = map(lambda x: string.strip(x), line.split("="))
+                                       keyValue = list(map(lambda x: x.strip(), line.split("=")))
                                        if keyValue[0] == "Pkg.Revision":
                                                versionParts = keyValue[1].split(".")
                                                return tuple(map(int, versionParts[0:2]))
@@ -303,8 +303,8 @@ class BuildStep:
                expandedInputs          = BuildStep.expandPathsToFiles(inputs)
                expandedOutputs         = BuildStep.expandPathsToFiles(outputs)
 
-               existingInputs          = filter(os.path.exists, expandedInputs)
-               existingOutputs         = filter(os.path.exists, expandedOutputs)
+               existingInputs          = list(filter(os.path.exists, expandedInputs))
+               existingOutputs         = list(filter(os.path.exists, expandedOutputs))
 
                if len(existingInputs) != len(expandedInputs):
                        for file in expandedInputs: