fix bug when there is no existing chromedriver exe
This commit is contained in:
parent
cea80717c5
commit
6fa2220cc0
|
@ -133,12 +133,13 @@ class Patcher(object):
|
||||||
if self.user_multi_procs:
|
if self.user_multi_procs:
|
||||||
with Lock():
|
with Lock():
|
||||||
files = list(p.rglob("*chromedriver*"))
|
files = list(p.rglob("*chromedriver*"))
|
||||||
most_recent = max(files, key=lambda f: f.stat().st_mtime)
|
if files:
|
||||||
files.remove(most_recent)
|
most_recent = max(files, key=lambda f: f.stat().st_mtime)
|
||||||
list(map(lambda f: f.unlink(), files))
|
files.remove(most_recent)
|
||||||
if self.is_binary_patched(most_recent):
|
list(map(lambda f: f.unlink(), files))
|
||||||
self.executable_path = str(most_recent)
|
if self.is_binary_patched(most_recent):
|
||||||
return True
|
self.executable_path = str(most_recent)
|
||||||
|
return True
|
||||||
|
|
||||||
if executable_path:
|
if executable_path:
|
||||||
self.executable_path = executable_path
|
self.executable_path = executable_path
|
||||||
|
|
Loading…
Reference in New Issue