diff options
author | Robert Geislinger <mail@crpykng.de> | 2022-11-11 08:43:08 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-11-11 15:48:29 +0530 |
commit | 7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78 (patch) | |
tree | 46969d7a58f67b81c2670d667fc0be40626b1ee9 /yt_dlp/update.py | |
parent | 8522226d2fea04d48802a9ef402438ff79227fe4 (diff) | |
download | hypervideo-pre-7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78.tar.lz hypervideo-pre-7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78.tar.xz hypervideo-pre-7aaf4cd2a8fd8ecf2123b981782c3d12dce80d78.zip |
[cleanup] Misc
Closes #5471, Closes #5312
Authored by: pukkandan, Alienmaster
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): |