Commit 4d2d5b4b authored by Lowell Manners's avatar Lowell Manners Committed by Commit Bot

Fix unhelpful error when gn.py run in wrong directory.

Before this change, when running gn.py outside of
the checkout, the error was:
AttributeError: 'NoneType' object has no attribute 'endswith'

R=scottmg@chromium.org
Bug: gn:14

Change-Id: I4f2f83b2a861bd6f9436c16c2c422fe18fab8f2a
Reviewed-on: https://chromium-review.googlesource.com/c/1299023Reviewed-by: 's avatarRobbie Iannucci <iannucci@chromium.org>
Reviewed-by: 's avatarScott Graham <scottmg@chromium.org>
Commit-Queue: Lowell Manners <lowell@google.com>
parent 4b49707c
......@@ -45,7 +45,9 @@ def main(args):
# Try in primary solution location first, with the gn binary having been
# downloaded by cipd in the projects DEPS.
gn_path = os.path.join(gclient_utils.GetPrimarySolutionPath(), 'third_party',
primary_solution_path = gclient_utils.GetPrimarySolutionPath()
if primary_solution_path:
gn_path = os.path.join(primary_solution_path, 'third_party',
'gn', 'gn' + gclient_utils.GetExeSuffix())
if os.path.exists(gn_path):
return subprocess.call([gn_path] + args[1:])
......
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