]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/update.py
[cleanup] Misc
[yt-dlp.git] / yt_dlp / update.py
index 6208aad8adbdcdc082711c2798666c6e0d5ff5cd..ac3e28057de84b7b776d7cdd7eb65b252e5920fa 100644 (file)
 @functools.cache
 def _get_variant_and_executable_path():
     """@returns (variant, executable_path)"""
-    if hasattr(sys, 'frozen'):
+    if getattr(sys, 'frozen', False):
         path = sys.executable
         if not hasattr(sys, '_MEIPASS'):
             return 'py2exe', path
-        if sys._MEIPASS == os.path.dirname(path):
+        elif sys._MEIPASS == os.path.dirname(path):
             return f'{sys.platform}_dir', path
-        if sys.platform == 'darwin':
+        elif sys.platform == 'darwin':
             machine = '_legacy' if version_tuple(platform.mac_ver()[0]) < (10, 15) else ''
         else:
             machine = f'_{platform.machine().lower()}'
@@ -288,7 +288,7 @@ def cmd(self):
         # There is no sys.orig_argv in py < 3.10. Also, it can be [] when frozen
         if getattr(sys, 'orig_argv', None):
             return sys.orig_argv
-        elif hasattr(sys, 'frozen'):
+        elif getattr(sys, 'frozen', False):
             return sys.argv
 
     def restart(self):