File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -214,9 +214,16 @@ def __init__(
214214 language = "en-US"
215215 options .add_argument ("--lang=%s" % language )
216216 if not options .binary_location :
217- options . binary_location = (
217+ binary_location = (
218218 browser_executable_path or find_chrome_executable ()
219219 )
220+ if binary_location :
221+ options .binary_location = binary_location
222+ else :
223+ # Improve the default error message in this situation.
224+ # Setting options.binary_location to None results in:
225+ # "TypeError: Binary Location Must be a String"
226+ raise Exception ("Chrome not found! Install it first!" )
220227 self ._delay = constants .UC .RECONNECT_TIME
221228 self .user_data_dir = user_data_dir
222229 self .keep_user_data_dir = keep_user_data_dir
You can’t perform that action at this time.
0 commit comments