Index: pylib/gyp/msvs_emulation.py |
diff --git a/pylib/gyp/msvs_emulation.py b/pylib/gyp/msvs_emulation.py |
index ca67b122f0b9b1d0544eebce9a66a678c9dd6853..5df7b310bf60b8c66361500473b1112b9c8f2993 100644 |
--- a/pylib/gyp/msvs_emulation.py |
+++ b/pylib/gyp/msvs_emulation.py |
@@ -1,4 +1,4 @@ |
-# Copyright (c) 2012 Google Inc. All rights reserved. |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
# Use of this source code is governed by a BSD-style license that can be |
scottmg
2015/12/05 00:05:04
gyp is google, not chrome
brucedawson
2015/12/05 00:09:04
Ah. The presubmit warning asked me to change it. I
|
# found in the LICENSE file. |
@@ -961,6 +961,10 @@ def _ExtractImportantEnvironment(output_of_set): |
'tmp', |
) |
env = {} |
+ # This occasionally happens and leads to misleading SYSTEMROOT error messages |
+ # if not caught here. |
+ if output_of_set.count("=") == 0: |
+ raise Exception("Invalid output_of_set. Value is:\n%s" % output_of_set) |
for line in output_of_set.splitlines(): |
for envvar in envvars_to_save: |
if re.match(envvar + '=', line.lower()): |
@@ -1029,6 +1033,8 @@ def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags, |
popen = subprocess.Popen( |
args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
variables, _ = popen.communicate() |
+ if popen.returncode != 0: |
+ raise Exception("'%s' failed with error %d" % (args, popen.returncode)) |
env = _ExtractImportantEnvironment(variables) |
# Inject system includes from gyp files into INCLUDE. |