aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2024-12-15 19:47:50 +0000
committerGitHub <noreply@github.com>2024-12-15 19:47:50 +0000
commit3d3ee458c1fe49dd5ebd7651a092119d23eb7000 (patch)
treed8c06be87a37812d1ceae01ecf08c8452a561d43
parent2037a6414f81db8080ca724dca506fde91974c5d (diff)
[update] Fix endless update loop for `linux_exe` builds (#11827)
Closes #11808 Authored by: bashonly
-rw-r--r--yt_dlp/update.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/yt_dlp/update.py b/yt_dlp/update.py
index ca2ec5f37..dfab132af 100644
--- a/yt_dlp/update.py
+++ b/yt_dlp/update.py
@@ -525,11 +525,16 @@ class Updater:
@functools.cached_property
def cmd(self):
"""The command-line to run the executable, if known"""
+ argv = None
# 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
+ argv = sys.orig_argv
elif getattr(sys, 'frozen', False):
- return sys.argv
+ argv = sys.argv
+ # linux_static exe's argv[0] will be /tmp/staticx-NNNN/yt-dlp_linux if we don't fixup here
+ if argv and os.getenv('STATICX_PROG_PATH'):
+ argv = [self.filename, *argv[1:]]
+ return argv
def restart(self):
"""Restart the executable"""