From 97a5afe0f3a2ab6ee41176863452e00e66820f83 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 27 Jun 2023 10:30:48 -0700 Subject: [PATCH] Fix test flake Test: th Bug: 289013326 Change-Id: Ib233978ff861b010bdc3bd1a02ea9baefe6a3489 --- tools/releasetools/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 5d102cd13a..39e1bdd2ca 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -1424,9 +1424,10 @@ def ResolveAVBSigningPathArgs(split_args): def ResolveBinaryPath(path): if os.path.exists(path): return path - new_path = os.path.join(OPTIONS.search_path, path) - if os.path.exists(new_path): - return new_path + if OPTIONS.search_path: + new_path = os.path.join(OPTIONS.search_path, path) + if os.path.exists(new_path): + return new_path raise ExternalError( "Failed to find {}".format(new_path))