mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 02:01:16 +00:00
workloads/meabo: Support python 3
Ensure output is encoded correctly if running with python 3
This commit is contained in:
parent
75f3080c9b
commit
93ffe0434c
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
from wa import Workload, Parameter, Executable, ConfigError, WorkloadError
|
from wa import Workload, Parameter, Executable, ConfigError, WorkloadError
|
||||||
from wa.utils.exec_control import once
|
from wa.utils.exec_control import once
|
||||||
@ -255,7 +256,10 @@ class Meabo(Workload):
|
|||||||
|
|
||||||
outfile = os.path.join(context.output_directory, 'meabo-output.txt')
|
outfile = os.path.join(context.output_directory, 'meabo-output.txt')
|
||||||
with open(outfile, 'wb') as wfh:
|
with open(outfile, 'wb') as wfh:
|
||||||
wfh.write(self.output)
|
if sys.version_info[0] == 3:
|
||||||
|
wfh.write(self.output.encode('utf-8'))
|
||||||
|
else:
|
||||||
|
wfh.write(self.output)
|
||||||
context.add_artifact('meabo-output', outfile, kind='raw')
|
context.add_artifact('meabo-output', outfile, kind='raw')
|
||||||
|
|
||||||
cur_phase = 0
|
cur_phase = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user