From f2dde586bd785af5b8f3924b513fdb62f639ed0f Mon Sep 17 00:00:00 2001 From: Adnan AlSinan Date: Fri, 6 Aug 2021 12:44:51 +0100 Subject: Fixing the Issue when building for Android using compress_kernels=1 and python 3 Resolves COMPMID-4759 Signed-off-by: Adnan AlSinan Change-Id: Iaa37c63682bbf900e42195f52f5264ea565cc46e Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6059 Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins Comments-Addressed: Gunes Bayir Reviewed-by: Gunes Bayir --- SConscript | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SConscript b/SConscript index 2f43e39e90..2eed75a1a5 100644 --- a/SConscript +++ b/SConscript @@ -25,6 +25,7 @@ import re import subprocess import zlib import json +import codecs VERSION = "v0.0-unreleased" LIBRARY_VERSION_MAJOR = 24 @@ -136,7 +137,8 @@ def resolve_includes(target, source, env): with open(file[1].target_name.get_path(), 'w+') as out_file: file_to_write = "\n".join( file[1].file_contents ) if env['compress_kernels']: - file_to_write = zlib.compress(file_to_write, 9).encode("base64").replace("\n", "") + file_to_write = zlib.compress(file_to_write.encode('utf-8'), 9) + file_to_write = codecs.encode(file_to_write, "base64").decode('utf-8').replace("\n", "") file_to_write = "R\"(" + file_to_write + ")\"" out_file.write(file_to_write) -- cgit v1.2.1