From 726a6a915921d08b6429c1ef5598dad2ce1840a0 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 17 Aug 2021 15:02:00 -0700 Subject: [PATCH] libsparse: python3. Test: treehugger Test: ran simg_dump.py on a file created by img2simg Change-Id: I999747867733a2e789c0da95add0bba83c36133f --- libsparse/Android.bp | 6 +++--- libsparse/simg_dump.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libsparse/Android.bp b/libsparse/Android.bp index 0b4b640ad..3f9aeb28a 100644 --- a/libsparse/Android.bp +++ b/libsparse/Android.bp @@ -85,11 +85,11 @@ python_binary_host { srcs: ["simg_dump.py"], version: { py2: { - embedded_launcher: true, - enabled: true, + enabled: false, }, py3: { - enabled: false, + embedded_launcher: true, + enabled: true, }, }, } diff --git a/libsparse/simg_dump.py b/libsparse/simg_dump.py index 82a03ad95..b0b3b2259 100755 --- a/libsparse/simg_dump.py +++ b/libsparse/simg_dump.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # Copyright (C) 2012 The Android Open Source Project # @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import print_function import csv import getopt import hashlib @@ -47,7 +46,7 @@ def main(): opts, args = getopt.getopt(sys.argv[1:], "vsc:", ["verbose", "showhash", "csvfile"]) - except getopt.GetoptError, e: + except getopt.GetoptError as e: print(e) usage(me) for o, a in opts: