Skip to content

Commit cc2f775

Browse files
jeremynHainish
authored andcommitted
Modify the platform check in test/script.py (EFForg#14876)
1 parent 04ec442 commit cc2f775

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/script.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# of linux is required for the script to run correctly as well.
1111
# Otherwise, use pyvirtualdisplay.
1212

13-
import sys, os, platform, time
13+
import sys, os, time
1414
from selenium import webdriver
1515
from selenium.common.exceptions import WebDriverException
1616
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
@@ -35,12 +35,14 @@ class bcolors:
3535
# Find the path to chromedriver
3636
chromedriver_path = "chromedriver"
3737
if sys.platform.startswith("linux"):
38-
if 'Ubuntu' in platform.linux_distribution():
39-
chromedriver_path = "/usr/lib/chromium-browser/chromedriver"
40-
elif 'debian' in platform.linux_distribution():
41-
#Debian is lowercase when platform.linux_distribution() is used.
42-
#This is not a mistake.
43-
chromedriver_path = "/usr/lib/chromium/chromedriver"
38+
locations = (
39+
"/usr/lib/chromium-browser/chromedriver",
40+
"/usr/lib/chromium/chromedriver",
41+
)
42+
for location in locations:
43+
if os.path.isfile(location):
44+
chromedriver_path = location
45+
break
4446

4547
try:
4648
# First argument is optional, if not specified will search path.

0 commit comments

Comments
 (0)