Skip to content

Commit

Permalink
Remove ARM specification for Macs
Browse files Browse the repository at this point in the history
Apparently the x64 version works on ARM devices with Mac, so the
platform now just chooses the correct platform name based on the
Chromedriver version requested
  • Loading branch information
jdholtz committed Aug 17, 2023
1 parent 1ef8e8c commit 29551bd
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions undetected_chromedriver/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,11 @@ def _set_platform_name(self):
self.platform_name = "linux64"
self.exe_name %= ""
if self.platform.endswith("darwin"):
self.platform_name = self._get_mac_platform_name()
self.exe_name %= ""

def _get_mac_platform_name(self):
"""
The Mac platform name changes based on the architecture and Chromedriver version desired
"""
platform_name = "mac"
# Matches the platform as a substring so values like 'arm64' and 'armv7l' work
is_arm_arch = any(p in platform.machine() for p in ["aarch64", "arm"])

if self.is_old_chromedriver:
if is_arm_arch:
platform_name += "_arm64"
else:
platform_name += "64"
else:
if is_arm_arch:
platform_name += "-arm64"
if self.is_old_chromedriver:
self.platform_name = "mac64"
else:
platform_name += "-x64"

return platform_name
self.platform_name = "mac-x64"
self.exe_name %= ""

def auto(self, executable_path=None, force=False, version_main=None, _=None):
"""
Expand Down

0 comments on commit 29551bd

Please sign in to comment.