diff options
Diffstat (limited to 'yt_dlp/update.py')
-rw-r--r-- | yt_dlp/update.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/yt_dlp/update.py b/yt_dlp/update.py index 6208aad8a..ac3e28057 100644 --- a/yt_dlp/update.py +++ b/yt_dlp/update.py @@ -30,13 +30,13 @@ API_URL = f'https://api.github.com/repos/{REPOSITORY}/releases' @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 @@ class Updater: # 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): |