From 9fa361576633d5c76fef5d06cfc13b224a5168a1 Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Wed, 21 Jun 2017 17:40:10 +0900 Subject: [PATCH] Make wptrun fail correctly when certutil not found (#6297) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make wptrun fail correctly when certutil not found This change makes wptrun correctly handle the case where it can’t find the certutil binary. Without this change you end up with the value of `path` being `None` when it reaches this part of the tools/browserutils/browser.py code: if os.path.splitdrive(path)[1].split(os.path.sep) == ["", "Windows", "system32", "certutil.exe"]: ... which results in: AttributeError: 'NoneType' object has no attribute 'split' So this change just early-returns `None` from there if `path` is `None`. --- tools/browserutils/browser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/browserutils/browser.py b/tools/browserutils/browser.py index 75f5421e6dd3b6..f0b11863a909e0 100644 --- a/tools/browserutils/browser.py +++ b/tools/browserutils/browser.py @@ -119,6 +119,8 @@ def find_binary(self): def find_certutil(self): path = find_executable("certutil") + if path is None: + return None if os.path.splitdrive(path)[1].split(os.path.sep) == ["", "Windows", "system32", "certutil.exe"]: return None return path