diff options
author | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2010-09-23 07:32:31 +0100 |
---|---|---|
committer | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2010-09-23 07:32:31 +0100 |
commit | fe072db6f1c91f022311d38a142fb25db7c77732 (patch) | |
tree | 7c204742dfd811ab0b107f9a679cb5db6c7c31f4 | |
parent | 92bf832c788554ea0349ef9b8c1090a152de24fc (diff) |
Fix crash when no mpd is installed
-rwxr-xr-x | archey3 | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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') |