From 9c857f8fb1085a1adfacc0c3091f7c07d7c60b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kosi=C5=84ski?= Date: Wed, 24 Feb 2021 16:02:25 -0800 Subject: Switch care_map_generator.py to Python 3. This is the last remaining use of the python-symbol library from Python 2. Test: Ran 2to3 on the script, no changes reported. Change-Id: I9c8bf4840eaf1832cabc4b6af831f5c2de554d4f --- update_verifier/Android.bp | 8 ++++---- update_verifier/care_map_generator.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/update_verifier/Android.bp b/update_verifier/Android.bp index f9a834185..ff2eff903 100644 --- a/update_verifier/Android.bp +++ b/update_verifier/Android.bp @@ -121,12 +121,12 @@ python_binary_host { version: { py2: { - enabled: true, - embedded_launcher: true, - }, - py3: { enabled: false, embedded_launcher: false, }, + py3: { + enabled: true, + embedded_launcher: true, + }, }, } diff --git a/update_verifier/care_map_generator.py b/update_verifier/care_map_generator.py index 051d98deb..c6f2dad24 100644 --- a/update_verifier/care_map_generator.py +++ b/update_verifier/care_map_generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2018 The Android Open Source Project # @@ -115,13 +115,13 @@ def main(argv): content = input_care_map.read() if args.parse_proto: - result = ParseProtoMessage(content, args.fingerprint_enabled) + result = ParseProtoMessage(content, args.fingerprint_enabled).encode() else: care_map_proto = GenerateCareMapProtoFromLegacyFormat( content.rstrip().splitlines(), args.fingerprint_enabled) result = care_map_proto.SerializeToString() - with open(args.output_file, 'w') as output: + with open(args.output_file, 'wb') as output: output.write(result) -- cgit v1.2.3