Skip to content

Commit

Permalink
Changed "is" to "==" !nocl (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasjani authored Aug 26, 2022
1 parent 75c26dd commit 81ff0a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/webdrivermanager/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def get_driver_filename(self):

def get_mac_cpu_type(self):
# Identify mac CPU type, refer to https://stackoverflow.com/questions/65970469/what-does-platform-system-and-platform-architecture-return-on-apple-m1-silic
return "m1" if platform.processor() is "arm" else "intel" if self.os_name == "mac" else ""
return "m1" if platform.processor() == "arm" else "intel" if self.os_name == "mac" else ""

def _parse_version(self, version):
method = version.strip().lower()
Expand Down Expand Up @@ -181,13 +181,13 @@ def _parse_github_api_response(self, version, response):
filenames = [asset["name"] for asset in response.json()["assets"]]
filename = [name for name in filenames if self.os_name in name]
mac_cpu_type = self.get_mac_cpu_type()

if not filename:
raise_runtime_error(f"Error, unable to find a download for os: {self.os_name}")

if len(filename) > 1:
if self.os_name is "mac":
filename = [name for name in filenames if "aarch64" in name] if mac_cpu_type is "arm" else [name for name in filenames if "aarch64" not in name]
if self.os_name == "mac":
filename = [name for name in filenames if "aarch64" in name] if mac_cpu_type == "arm" else [name for name in filenames if "aarch64" not in name]
else:
filename = [name for name in filenames if self.os_name + self.bitness in name and not name.endswith(".asc")]
if len(filename) != 1:
Expand Down Expand Up @@ -292,7 +292,7 @@ def download_and_install(self, version="latest", show_progress_bar=True):
actual_driver_filename = None

driver_filename = self.get_driver_filename()
if driver_filename is None:
if driver_filename == None:
raise_runtime_error(f"Error, unable to find appropriate drivername for {self.os_name}.")

force = False
Expand Down

0 comments on commit 81ff0a2

Please sign in to comment.