Skip to content

Commit

Permalink
Fix bad return type identified by pytype.
Browse files Browse the repository at this point in the history
The function is properly annotated as returning a `bool` but it was actually
returning `None` which changes the return type.

PiperOrigin-RevId: 700808781
  • Loading branch information
kenjitoyama authored and copybara-github committed Nov 27, 2024
1 parent 99afa38 commit 5baecdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android_env/components/app_screen_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def matches_path(
'view_hierarchy is None. Dumpsys activity output: %s. tree: %r',
str(dumpsys_activity_output), root.print_tree())
logging.error('Tree root: %s', str(root))
return None # pytype: disable=bad-return-type
return False

current_node = view_hierarchy
for i, regex in enumerate(expected_view_hierarchy_path):
Expand All @@ -167,7 +167,7 @@ def regex_predicate(node, expr=regex):
regex.pattern, current_node)
logging.error('Dumpsys activity output: %s', str(dumpsys_activity_output))
logging.error('Tree root: %s', str(root))
return None # pytype: disable=bad-return-type
return False
else:
current_node = child
return True
Expand Down

0 comments on commit 5baecdd

Please sign in to comment.