Merge "Update caremap to by py3 compatible" am: 18370833aa

Original change: https://android-review.googlesource.com/c/platform/bootable/recovery/+/1855545

Change-Id: I9e1e721ebb31568b2917b306bd07631554172d94
This commit is contained in:
Treehugger Robot 2021-10-15 02:29:27 +00:00 committed by Automerger Merge Worker
commit 61707b973c

View file

@ -111,14 +111,14 @@ def main(argv):
logging.basicConfig(level=logging.INFO if args.verbose else logging.WARNING,
format=logging_format)
with open(args.input_care_map, 'r') as input_care_map:
with open(args.input_care_map, 'rb') as input_care_map:
content = input_care_map.read()
if args.parse_proto:
result = ParseProtoMessage(content, args.fingerprint_enabled).encode()
else:
care_map_proto = GenerateCareMapProtoFromLegacyFormat(
content.rstrip().splitlines(), args.fingerprint_enabled)
content.decode().rstrip().splitlines(), args.fingerprint_enabled)
result = care_map_proto.SerializeToString()
with open(args.output_file, 'wb') as output: