mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-20 09:40:50 +01:00
workloads/pcmark: Fix reading results in python3
Ensure that the results file is decoded when using python3.
This commit is contained in:
parent
d858435c3d
commit
5afc96dc4d
@ -14,6 +14,7 @@
|
|||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
from wa import ApkUiautoWorkload
|
from wa import ApkUiautoWorkload
|
||||||
@ -58,6 +59,8 @@ class PcMark(ApkUiautoWorkload):
|
|||||||
def update_output(self, context):
|
def update_output(self, context):
|
||||||
expected_results = len(self.regex_matches)
|
expected_results = len(self.regex_matches)
|
||||||
zf = zipfile.ZipFile(os.path.join(context.output_directory, self.result_file), 'r').read('Result.xml')
|
zf = zipfile.ZipFile(os.path.join(context.output_directory, self.result_file), 'r').read('Result.xml')
|
||||||
|
if sys.version_info[0] == 3:
|
||||||
|
zf = zf.decode(sys.stdout.encoding)
|
||||||
for line in zf.split('\n'):
|
for line in zf.split('\n'):
|
||||||
for regex in self.regex_matches:
|
for regex in self.regex_matches:
|
||||||
match = regex.search(line)
|
match = regex.search(line)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user