code_size_compare: make sure _remove_worktree executed
Add try and finally to make sure we remove worktree as expected even if we hit errors by accident. Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
9e8b671b1c
commit
6ae94a0a72
1 changed files with 5 additions and 3 deletions
|
@ -423,8 +423,10 @@ class CodeSizeCalculator:
|
|||
"""
|
||||
|
||||
git_worktree_path = self._create_git_worktree()
|
||||
try:
|
||||
self._build_libraries(git_worktree_path)
|
||||
res = self._gen_raw_code_size(git_worktree_path)
|
||||
finally:
|
||||
self._remove_worktree(git_worktree_path)
|
||||
|
||||
return res
|
||||
|
|
Loading…
Reference in a new issue