From b73dbb1a352f06092d8d0a869363eb8ddc0922e5 Mon Sep 17 00:00:00 2001 From: ncoop Date: Sat, 4 Jun 2016 20:53:12 -0700 Subject: [PATCH] Return early if the check threw an error. --- i3pystatus/updates/dnf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/i3pystatus/updates/dnf.py b/i3pystatus/updates/dnf.py index 360d764..31125a4 100644 --- a/i3pystatus/updates/dnf.py +++ b/i3pystatus/updates/dnf.py @@ -17,8 +17,10 @@ class Dnf(Backend): def updates(self): command = ["dnf", "check-update"] dnf = run_through_shell(command) - raw = dnf.out + if dnf.err: + return "?", dnf.err + raw = dnf.out update_count = 0 if dnf.rc == 100: lines = raw.splitlines()[2:]