File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 2525 "CDP" ,
2626 "find_chrome_executable" ,
2727)
28+ IS_MAC = "darwin" in sys .platform
2829IS_POSIX = sys .platform .startswith (("darwin" , "cygwin" , "linux" ))
2930logger = logging .getLogger ("uc" )
3031logger .setLevel (logging .getLogger ().getEffectiveLevel ())
@@ -311,7 +312,21 @@ def __init__(
311312 setattr (service_ , "creationflags" , creationflags )
312313 if hasattr (service_ , "creation_flags" ):
313314 setattr (service_ , "creation_flags" , creationflags )
314- super ().__init__ (options = options , service = service_ )
315+ try :
316+ super ().__init__ (options = options , service = service_ )
317+ except OSError as e :
318+ if IS_MAC and "Bad CPU type in executable" in str (e ):
319+ print (str (e ))
320+ message = (
321+ "Missing a macOS dependency:\n "
322+ "Your Mac needs Rosetta 2 to use UC Mode!\n "
323+ 'Run: "softwareupdate --install-rosetta"\n '
324+ "Info: "
325+ "https://apple.stackexchange.com/a/408379/607628"
326+ )
327+ raise Exception (message )
328+ else :
329+ raise
315330 self .reactor = None
316331 if enable_cdp_events :
317332 if logging .getLogger ().getEffectiveLevel () == logging .DEBUG :
You can’t perform that action at this time.
0 commit comments