diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-01-07 18:35:24 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-01-07 18:35:24 +0100 |
commit | c1eef79e20033fc3441d6c9c013cd96f5aebfbc2 (patch) | |
tree | 9a5dcbab02055ba1bff03cf99e2015089a12836c /whatmaps | |
parent | 97de5049bfabf16c4510148f51bc253178b5de3c (diff) |
Don't fail if lsb_release is missingv0.0.3
Diffstat (limited to 'whatmaps')
-rwxr-xr-x | whatmaps | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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 |