Skip to content

Commit

Permalink
[tools] gn.py: Ensures args parsed.
Browse files Browse the repository at this point in the history
Since parse_args() returns None in case parsing failed we should
check for this and bail.
Previously we'd still try to run RunGnOnConfiguredConfigurations
on None and crash with an unrelated issue.
This would overshadow the otherwise nice error message.

Change-Id: If9e267c8eedaaacb388fd8f8475ec0e861060ed5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187900
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
  • Loading branch information
Clement Skau authored and commit-bot@chromium.org committed Feb 26, 2021
1 parent 6a43d6e commit 4d99c94
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,17 @@ def cleanup(command):

def Main(argv):
starttime = time.time()

args = parse_args(argv)
if args is None:
return 1

result = RunGnOnConfiguredConfigurations(args)

endtime = time.time()
if args.verbose:
endtime = time.time()
print("GN Time: %.3f seconds" % (endtime - starttime))

return result


Expand Down

0 comments on commit 4d99c94

Please sign in to comment.