From 2141e4fd2b09d3a8a95e032fb02eafb9e6f818c9 Mon Sep 17 00:00:00 2001 From: Chris Wood Date: Fri, 18 Jul 2014 11:19:07 -0400 Subject: [PATCH] Add exception handling for output --- i3pystatus/shell.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/i3pystatus/shell.py b/i3pystatus/shell.py index e97a3cb..54a1d93 100644 --- a/i3pystatus/shell.py +++ b/i3pystatus/shell.py @@ -26,9 +26,11 @@ class Shell(IntervalModule): color = self.error_color out = out.decode("UTF-8").replace("\n", " ") - - if out[-1] == " ": - out = out[:-1] + try: + if out[-1] == " ": + out = out[:-1] + except: + out = "" self.output = { "full_text": out,