No bug: Make ./mach clobber work on windows without winrm.exe. r=me
authorKyle Huey <khuey@kylehuey.com>
Tue, 11 Aug 2015 06:10:46 -0700
changeset 277168 cd84db0152b02a85e005058d19fe02a25cb1b012
parent 277167 a13c1f26e351dd6251da641fe7a9eb53790fc2d0
child 277169 e158708d4ca309e32095175626d856c7861c43e5
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-esr52@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
milestone43.0a1
No bug: Make ./mach clobber work on windows without winrm.exe. r=me
python/mozbuild/mozbuild/base.py
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -310,20 +310,23 @@ class MozbuildObject(ProcessExecutionMix
 
     def is_clobber_needed(self):
         if not os.path.exists(self.topobjdir):
             return False
         return Clobberer(self.topsrcdir, self.topobjdir).clobber_needed()
 
     def have_winrm(self):
         # `winrm -h` should print 'winrm version ...' and exit 1
-        p = subprocess.Popen(['winrm.exe', '-h'],
-                             stdout=subprocess.PIPE,
-                             stderr=subprocess.STDOUT)
-        return p.wait() == 1 and p.stdout.read().startswith('winrm')
+        try:
+            p = subprocess.Popen(['winrm.exe', '-h'],
+                                 stdout=subprocess.PIPE,
+                                 stderr=subprocess.STDOUT)
+            return p.wait() == 1 and p.stdout.read().startswith('winrm')
+        except:
+            return False
 
     def remove_objdir(self):
         """Remove the entire object directory."""
 
         if sys.platform.startswith('win') and self.have_winrm():
             subprocess.check_call(['winrm', '-rf', self.topobjdir])
         else:
             # We use mozfile because it is faster than shutil.rmtree().