No bug: Make ./mach clobber work on windows without winrm.exe. r=me

This commit is contained in:
Kyle Huey 2015-08-11 06:10:46 -07:00
parent 0a62d4d460
commit b0c9371d90

View File

@ -315,10 +315,13 @@ class MozbuildObject(ProcessExecutionMixin):
def have_winrm(self): def have_winrm(self):
# `winrm -h` should print 'winrm version ...' and exit 1 # `winrm -h` should print 'winrm version ...' and exit 1
try:
p = subprocess.Popen(['winrm.exe', '-h'], p = subprocess.Popen(['winrm.exe', '-h'],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
return p.wait() == 1 and p.stdout.read().startswith('winrm') return p.wait() == 1 and p.stdout.read().startswith('winrm')
except:
return False
def remove_objdir(self): def remove_objdir(self):
"""Remove the entire object directory.""" """Remove the entire object directory."""