1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-04 00:55:15 +00:00

[cleanup] Misc

Closes #5471, Closes #5312

Authored by: pukkandan, Alienmaster
This commit is contained in:
Robert Geislinger
2022-11-11 08:43:08 +05:30
committed by pukkandan
parent 8522226d2f
commit 7aaf4cd2a8
8 changed files with 19 additions and 19 deletions

View File

@ -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):