summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurie Clark-Michalek <bluepeppers@archlinux.us>2010-09-23 07:32:31 +0100
committerLaurie Clark-Michalek <bluepeppers@archlinux.us>2010-09-23 07:32:31 +0100
commitfe072db6f1c91f022311d38a142fb25db7c77732 (patch)
tree7c204742dfd811ab0b107f9a679cb5db6c7c31f4
parent92bf832c788554ea0349ef9b8c1090a152de24fc (diff)
Fix crash when no mpd is installed
-rwxr-xr-xarchey310
1 files changed, 8 insertions, 2 deletions
diff --git a/archey3 b/archey3
index 4403049..b76f57b 100755
--- a/archey3
+++ b/archey3
@@ -161,7 +161,10 @@ class display(object):
cmd = self.command_line.format(arg1=self.arg1)
else:
cmd = self.command_line
- self.proccess = Popen(cmd.split(), stdin=PIPE, stdout=PIPE, stderr=PIPE)
+ try:
+ self.proccess = Popen(cmd.split(), stdin=PIPE, stdout=PIPE, stderr=PIPE)
+ except Exception as e:
+ pass
def render(self):
(stdoutdata, stderrdata) = self.proccess.communicate(self.stdindata or None)
@@ -348,7 +351,10 @@ class mpdDisplay(display):
except Exception:
return False
else:
- return super().render()
+ if hasattr(self, "proccess"):
+ return super().render()
+ else:
+ return None
def format_output(self, instring):
lines = instring.split('\n')