summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-01-07 18:35:24 +0100
committerGuido Günther <agx@sigxcpu.org>2014-01-07 18:35:24 +0100
commitc1eef79e20033fc3441d6c9c013cd96f5aebfbc2 (patch)
tree9a5dcbab02055ba1bff03cf99e2015089a12836c
parent97de5049bfabf16c4510148f51bc253178b5de3c (diff)
Don't fail if lsb_release is missingv0.0.3
-rwxr-xr-xwhatmaps12
1 files 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