@@ -495,7 +495,7 @@ def _GetSdkVersionInfoItem(self, sdk, infoitem):
495
495
# Since the CLT has no SDK paths anyway, returning None is the
496
496
# most sensible route and should still do the right thing.
497
497
try :
498
- return GetStdout (['xcrun' , '--sdk' , sdk , infoitem ])
498
+ return GetStdoutQuiet (['xcrun' , '--sdk' , sdk , infoitem ])
499
499
except :
500
500
pass
501
501
@@ -1392,7 +1392,7 @@ def XcodeVersion():
1392
1392
if XCODE_VERSION_CACHE :
1393
1393
return XCODE_VERSION_CACHE
1394
1394
try :
1395
- version_list = GetStdout (['xcodebuild' , '-version' ]).splitlines ()
1395
+ version_list = GetStdoutQuiet (['xcodebuild' , '-version' ]).splitlines ()
1396
1396
# In some circumstances xcodebuild exits 0 but doesn't return
1397
1397
# the right results; for example, a user on 10.7 or 10.8 with
1398
1398
# a bogus path set via xcode-select
@@ -1442,6 +1442,17 @@ def CLTVersion():
1442
1442
continue
1443
1443
1444
1444
1445
+ def GetStdoutQuiet (cmdlist ):
1446
+ """Returns the content of standard output returned by invoking |cmdlist|.
1447
+ Ignores the stderr.
1448
+ Raises |GypError| if the command return with a non-zero return code."""
1449
+ job = subprocess .Popen (cmdlist , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
1450
+ out = job .communicate ()[0 ]
1451
+ if job .returncode != 0 :
1452
+ raise GypError ('Error %d running %s' % (job .returncode , cmdlist [0 ]))
1453
+ return out .rstrip ('\n ' )
1454
+
1455
+
1445
1456
def GetStdout (cmdlist ):
1446
1457
"""Returns the content of standard output returned by invoking |cmdlist|.
1447
1458
Raises |GypError| if the command return with a non-zero return code."""
0 commit comments