Skip to content

Commit

Permalink
arch_updates module: handle yay return code better when there are no …
Browse files Browse the repository at this point in the history
…updates (#2214)
  • Loading branch information
geoffliu authored Oct 10, 2023
1 parent 8df6d63 commit 1092630
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py3status/modules/arch_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ def _get_yay_updates(self):
try:
updates = self.py3.command_output(["yay", "-Qua"])
return len(updates.splitlines())
except self.py3.CommandError:
return None
except self.py3.CommandError as ce:
# yay returns 1 if there are no updates.
return 0 if ce.error_code == 1 else None

def _get_paru_updates(self):
try:
Expand Down

0 comments on commit 1092630

Please sign in to comment.