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 25
25
"CDP" ,
26
26
"find_chrome_executable" ,
27
27
)
28
+ IS_MAC = "darwin" in sys .platform
28
29
IS_POSIX = sys .platform .startswith (("darwin" , "cygwin" , "linux" ))
29
30
logger = logging .getLogger ("uc" )
30
31
logger .setLevel (logging .getLogger ().getEffectiveLevel ())
@@ -311,7 +312,21 @@ def __init__(
311
312
setattr (service_ , "creationflags" , creationflags )
312
313
if hasattr (service_ , "creation_flags" ):
313
314
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
315
330
self .reactor = None
316
331
if enable_cdp_events :
317
332
if logging .getLogger ().getEffectiveLevel () == logging .DEBUG :
You can’t perform that action at this time.
0 commit comments