@@ -817,7 +817,7 @@ def find_gpu_model(model):
817817 return gpu
818818 return None
819819
820- for i in range (0 , 16 ):
820+ for i in range (16 ):
821821 try :
822822 hHardwareReg = winreg .OpenKey (winreg .HKEY_LOCAL_MACHINE , 'HARDWARE' )
823823 hDeviceMapReg = winreg .OpenKey (hHardwareReg , 'DEVICEMAP' )
@@ -1398,7 +1398,7 @@ def get_system_info(format_json):
13981398 if len (gpus ) == 1 :
13991399 info += 'GPU: ' + gpus [0 ]['model' ] + ' with ' + str (gpus [0 ]['ram' ] // 1024 // 1024 ) + " MB of VRAM\n "
14001400 elif len (gpus ) > 1 :
1401- for i in range (0 , len (gpus )):
1401+ for i in range (len (gpus )):
14021402 info += 'GPU' + str (i ) + ": " + gpus [i ]['model' ] + ' with ' + str (gpus [i ]['ram' ] // 1024 // 1024 ) + ' MBs of VRAM\n '
14031403 info += 'UUID: ' + unique_system_id
14041404 return info .strip ()
@@ -1427,7 +1427,6 @@ def list_processes_by_name(exe_full_path):
14271427 except Exception :
14281428 # Fail gracefully if psutil not available
14291429 logv ('import psutil failed, unable to detect browser processes' )
1430- pass
14311430
14321431 logv ('Searching for processes by full path name "' + exe_full_path + '".. found ' + str (len (pids )) + ' entries' )
14331432
@@ -1637,15 +1636,15 @@ def run(args): # noqa: C901, PLR0912, PLR0915
16371636 file_to_serve = options .serve
16381637 else :
16391638 file_to_serve = '.'
1640- file_to_serve_is_url = file_to_serve .startswith ('file://' ) or file_to_serve . startswith ( 'http://' ) or file_to_serve . startswith ( 'https://' )
1639+ file_to_serve_is_url = file_to_serve .startswith (( 'file://' , 'http://' , 'https://' ) )
16411640
16421641 if options .serve_root :
16431642 serve_dir = os .path .abspath (options .serve_root )
16441643 else :
16451644 if file_to_serve == '.' or file_to_serve_is_url :
16461645 serve_dir = os .path .abspath ('.' )
16471646 else :
1648- if file_to_serve .endswith ('/' ) or file_to_serve . endswith ( '\\ ' ) or os .path .isdir (file_to_serve ):
1647+ if file_to_serve .endswith (( '/' , '\\ ' ) ) or os .path .isdir (file_to_serve ):
16491648 serve_dir = file_to_serve
16501649 else :
16511650 serve_dir = os .path .dirname (os .path .abspath (file_to_serve ))
@@ -1684,7 +1683,7 @@ def run(args): # noqa: C901, PLR0912, PLR0915
16841683 return 1
16851684 elif options .browser == 'firefox' :
16861685 browser_app = 'org.mozilla.firefox/org.mozilla.gecko.BrowserApp'
1687- elif options .browser == 'firefox_nightly' or options . browser == 'fenix' :
1686+ elif options .browser in { 'firefox_nightly' , 'fenix' } :
16881687 browser_app = 'org.mozilla.fenix/org.mozilla.gecko.BrowserApp'
16891688 elif options .browser == 'chrome' :
16901689 browser_app = 'com.android.chrome/com.google.android.apps.chrome.Main'
0 commit comments