From c1eef79e20033fc3441d6c9c013cd96f5aebfbc2 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 7 Jan 2014 18:35:24 +0100 Subject: Don't fail if lsb_release is missing --- whatmaps | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/whatmaps b/whatmaps index cbece71..d775098 100755 --- a/whatmaps +++ b/whatmaps @@ -425,12 +425,16 @@ def detect_distro(): if lsb_release: id = lsb_release.get_distro_information()['ID'] else: - lsb_cmd = subprocess.Popen(['lsb_release', '--id', '-s'], + try: + lsb_cmd = subprocess.Popen(['lsb_release', '--id', '-s'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output = lsb_cmd.communicate()[0] - if not lsb_cmd.returncode: - id = output.strip() + output = lsb_cmd.communicate()[0] + if not lsb_cmd.returncode: + id = output.strip() + except OSError: + # id is None in this case + pass if id == DebianDistro.id: return DebianDistro -- cgit v1.2.3