Commit fc77baee authored by Hitoshi Yoshida's avatar Hitoshi Yoshida Committed by Commit Bot

bindings: Do not try to list files in non existing directory

Running bindings_test on local machine without --reset-results
removes all temporary generated cache files.
In the process, we get a list of files to be removed,
but it fails if the target directory does not exist.
This happens when a test fails in some situation.

This CL makes to skip iterating non existing directories.

Bug: None
Change-Id: Ib18dc2bd4ab8fa5d93863e5d29ca97cbd7241384
Reviewed-on: https://chromium-review.googlesource.com/c/1295757Reviewed-by: default avatarKenichi Ishibashi <bashi@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602204}
parent 252d41fc
......@@ -197,6 +197,9 @@ def bindings_tests(output_directory, verbose, suppress_diff):
executive = Executive()
def list_files(directory):
if not os.path.isdir(directory):
return []
files = []
for component in os.listdir(directory):
if component not in COMPONENT_DIRECTORY:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment