From 08a8f78727352dbb829242dac499070b97ecb1af Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Thu, 9 May 2024 23:17:35 +0300 Subject: [PATCH] claudia_launcher: Gracefully handle empty result from dpkg --get-selections --- src/claudia_launcher.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/claudia_launcher.py b/src/claudia_launcher.py index 64af08e..afdf6a2 100755 --- a/src/claudia_launcher.py +++ b/src/claudia_launcher.py @@ -699,9 +699,11 @@ class ClaudiaLauncher(QWidget, ui_claudia_launcher.Ui_ClaudiaLauncherW): elif os.path.exists("/usr/bin/dpkg"): pkg_out = getoutput("env LANG=C LC_ALL=C /usr/bin/dpkg --get-selections 2>/dev/null").split("\n") for pkg_info in pkg_out: - package, installed = pkg_info.rsplit("\t", 1) - if installed == "install": - pkglist.append(package.strip()) + pkg_info = pkg_info.strip() + if pkg_info: + package, installed = pkg_info.rsplit("\t", 1) + if installed == "install": + pkglist.append(package.strip()) elif os.path.exists("/bin/rpm"): pkg_out = getoutput("env LANG=C /bin/rpm -qa --qf \"%{NAME}\n\" 2>/dev/null").split("\n")