diff options
author | Oliver Chang <oliverchang@users.noreply.github.com> | 2020-05-07 17:19:57 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 17:19:57 +1000 |
commit | af766f3f2c64023de98d008dc9b6061510bf714c (patch) | |
tree | ef7c3e6a7f54519256d8d36150dccd54a8cf4326 /infra/bisector.py | |
parent | 191b4f6009b066363de22553c269c3a11e717f16 (diff) |
bisector: always reset projects/ even when we exception out. (#3769)
Diffstat (limited to 'infra/bisector.py')
-rw-r--r-- | infra/bisector.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/infra/bisector.py b/infra/bisector.py index 8a5b78a1..4e88bd8e 100644 --- a/infra/bisector.py +++ b/infra/bisector.py @@ -296,16 +296,15 @@ def bisect(bisect_type, old_commit, new_commit, test_case_path, fuzz_target, Raises: ValueError: when a repo url can't be determine from the project. """ - result = _bisect(bisect_type, old_commit, new_commit, test_case_path, + try: + return _bisect(bisect_type, old_commit, new_commit, test_case_path, fuzz_target, build_data) - - # Clean up projects/ as _bisect may have modified it. - oss_fuzz_repo_manager = repo_manager.BaseRepoManager(helper.OSS_FUZZ_DIR) - oss_fuzz_repo_manager.git(['reset', 'projects']) - oss_fuzz_repo_manager.git(['checkout', 'projects']) - oss_fuzz_repo_manager.git(['clean', '-fxd', 'projects']) - - return result + finally: + # Clean up projects/ as _bisect may have modified it. + oss_fuzz_repo_manager = repo_manager.BaseRepoManager(helper.OSS_FUZZ_DIR) + oss_fuzz_repo_manager.git(['reset', 'projects']) + oss_fuzz_repo_manager.git(['checkout', 'projects']) + oss_fuzz_repo_manager.git(['clean', '-fxd', 'projects']) if __name__ == '__main__': |