Merge "Fix python3 errors: "TypeError: write() argument must be str, not bytes"" am: 955ee3712d
am: 2e44a5303c
am: 40e9d87fdf
Original change: https://android-review.googlesource.com/c/platform/build/+/1977398 Change-Id: I7464f81079946b99c9c3e98401c09fdd9f04018c
This commit is contained in:
commit
68e1e13857
1 changed files with 4 additions and 4 deletions
|
@ -170,16 +170,16 @@ def AddVendor(output_zip, recovery_img=None, boot_img=None):
|
||||||
return img.name
|
return img.name
|
||||||
|
|
||||||
def output_sink(fn, data):
|
def output_sink(fn, data):
|
||||||
ofile = open(os.path.join(OPTIONS.input_tmp, "VENDOR", fn), "w")
|
output_file = os.path.join(OPTIONS.input_tmp, "VENDOR", fn)
|
||||||
ofile.write(data)
|
with open(output_file, "wb") as ofile:
|
||||||
ofile.close()
|
ofile.write(data)
|
||||||
|
|
||||||
if output_zip:
|
if output_zip:
|
||||||
arc_name = "VENDOR/" + fn
|
arc_name = "VENDOR/" + fn
|
||||||
if arc_name in output_zip.namelist():
|
if arc_name in output_zip.namelist():
|
||||||
OPTIONS.replace_updated_files_list.append(arc_name)
|
OPTIONS.replace_updated_files_list.append(arc_name)
|
||||||
else:
|
else:
|
||||||
common.ZipWrite(output_zip, ofile.name, arc_name)
|
common.ZipWrite(output_zip, output_file, arc_name)
|
||||||
|
|
||||||
board_uses_vendorimage = OPTIONS.info_dict.get(
|
board_uses_vendorimage = OPTIONS.info_dict.get(
|
||||||
"board_uses_vendorimage") == "true"
|
"board_uses_vendorimage") == "true"
|
||||||
|
|
Loading…
Reference in a new issue