aboutsummaryrefslogtreecommitdiff
path: root/whatmaps/distro.py
diff options
context:
space:
mode:
Diffstat (limited to 'whatmaps/distro.py')
-rw-r--r--whatmaps/distro.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/whatmaps/distro.py b/whatmaps/distro.py
index 29d2dc2..d4f991b 100644
--- a/whatmaps/distro.py
+++ b/whatmaps/distro.py
@@ -112,6 +112,7 @@ class Distro(object):
def detect():
return detect()
+
import whatmaps.debiandistro # noqa: E402
import whatmaps.redhatdistro # noqa: E402
@@ -129,10 +130,10 @@ def detect():
try:
lsb_cmd = subprocess.Popen(['lsb_release', '--id', '-s'],
stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ stderr=subprocess.DEVNULL)
output = lsb_cmd.communicate()[0]
if not lsb_cmd.returncode:
- id = output.strip()
+ id = output.decode().split('\n')[0].strip()
except OSError:
# id is None in this case
pass