Merge "Update deprecated_at_birth script" am: 033de61f59
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2059569
Change-Id: I789294f78d144121a9d9336cf922b803a6b47458
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/tools/apilint/deprecated_at_birth.py b/tools/apilint/deprecated_at_birth.py
old mode 100644
new mode 100755
index 297d9c3b..da9f19f
--- a/tools/apilint/deprecated_at_birth.py
+++ b/tools/apilint/deprecated_at_birth.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (C) 2021 The Android Open Source Project
#
@@ -208,17 +208,17 @@
def _parse_stream_path(path):
api = {}
- print "Parsing", path
+ print("Parsing %s" % path)
for f in os.listdir(path):
f = os.path.join(path, f)
if not os.path.isfile(f): continue
if not f.endswith(".txt"): continue
if f.endswith("removed.txt"): continue
- print "\t", f
+ print("\t%s" % f)
with open(f) as s:
api = _parse_stream(s, api)
- print "Parsed", len(api), "APIs"
- print
+ print("Parsed %d APIs" % len(api))
+ print()
return api
@@ -306,8 +306,8 @@
if "@Deprecated " in i.raw:
error(clazz, i, None, "Found API deprecation at birth " + i.ident)
- print "%s Deprecated at birth %s\n" % ((format(fg=WHITE, bg=BLUE, bold=True),
- format(reset=True)))
+ print("%s Deprecated at birth %s\n" % ((format(fg=WHITE, bg=BLUE, bold=True),
+ format(reset=True))))
for f in sorted(failures):
- print failures[f]
- print
+ print(failures[f])
+ print()