Handle removed classes when looking for deprecated at birth APIs.

Removed APIs cause a KeyError when looking them up in the current API
surface. Instead, check if they're there first and if not just move on
since they no longer exist.

Bug: 129975435
Test: looked for new and deprecated system APIs
Change-Id: I46daa83ec8376190112418720f848afdf7cd7df2
This commit is contained in:
Michael Wright
2019-04-29 22:37:00 +01:00
parent 46669aa717
commit 42dcfb8f57

View File

@@ -2132,6 +2132,10 @@ def show_deprecations_at_birth(cur, prev):
# Remove all existing things so we're left with new
for prev_clazz in prev.values():
if prev_clazz.fullname not in cur:
# The class was removed this release; we can safely ignore it.
continue
cur_clazz = cur[prev_clazz.fullname]
if not is_interesting(cur_clazz): continue