From fe072db6f1c91f022311d38a142fb25db7c77732 Mon Sep 17 00:00:00 2001 From: Laurie Clark-Michalek Date: Thu, 23 Sep 2010 07:32:31 +0100 Subject: Fix crash when no mpd is installed --- archey3 | 10 ++++++++-- 1 file 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') -- cgit v1.2.3-54-g00ecf