From b0c9371d90363ba686343d7e7a3c09a62bc33c07 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Tue, 11 Aug 2015 06:10:46 -0700 Subject: [PATCH] No bug: Make ./mach clobber work on windows without winrm.exe. r=me --- python/mozbuild/mozbuild/base.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py index c76e369bffe..8b4ea73f5db 100644 --- a/python/mozbuild/mozbuild/base.py +++ b/python/mozbuild/mozbuild/base.py @@ -315,10 +315,13 @@ class MozbuildObject(ProcessExecutionMixin): 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."""