[build] Allow building with py2exe (and misc fixes)

py2exe config is copied from youtube-dl
Closes #1160
This commit is contained in:
pukkandan
2021-10-04 02:25:13 +05:30
parent a1c3967307
commit 5d535b4a55
5 changed files with 100 additions and 47 deletions

View File

@@ -4521,11 +4521,10 @@ def is_outdated_version(version, limit, assume_new=True):
def ytdl_is_updateable():
""" Returns if yt-dlp can be updated with -U """
return False
from zipimport import zipimporter
from .update import is_non_updateable
return isinstance(globals().get('__loader__'), zipimporter) or hasattr(sys, 'frozen')
return not is_non_updateable()
def args_to_str(args):