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,10 +45,12 @@ def main(args): ...@@ -45,10 +45,12 @@ def main(args):
# Try in primary solution location first, with the gn binary having been # Try in primary solution location first, with the gn binary having been
# downloaded by cipd in the projects DEPS. # downloaded by cipd in the projects DEPS.
gn_path = os.path.join(gclient_utils.GetPrimarySolutionPath(), 'third_party', primary_solution_path = gclient_utils.GetPrimarySolutionPath()
'gn', 'gn' + gclient_utils.GetExeSuffix()) if primary_solution_path:
if os.path.exists(gn_path): gn_path = os.path.join(primary_solution_path, 'third_party',
return subprocess.call([gn_path] + args[1:]) 'gn', 'gn' + gclient_utils.GetExeSuffix())
if os.path.exists(gn_path):
return subprocess.call([gn_path] + args[1:])
# Otherwise try the old .sha1 and download_from_google_storage locations # Otherwise try the old .sha1 and download_from_google_storage locations
# inside of buildtools. # inside of buildtools.
......
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