Skip to content

Commit

Permalink
Make wptrun fail correctly when certutil not found (#6297)
Browse files Browse the repository at this point in the history
* 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`.
  • Loading branch information
sideshowbarker authored and jgraham committed Jun 21, 2017
1 parent d6c43f5 commit 9fa3615
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/browserutils/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9fa3615

Please sign in to comment.