Ubuntu Pastebin

Paste from Chipaca at Thu, 13 Aug 2015 10:50:43 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
=== modified file 'aptsources/distro.py'
--- aptsources/distro.py	2014-10-24 10:16:01 +0000
+++ aptsources/distro.py	2015-08-13 10:50:13 +0000
@@ -466,13 +466,13 @@
 
 def _lsb_release():
     """Call lsb_release --idrc and return a mapping."""
-    from subprocess import Popen, PIPE
+    from subprocess import Popen, PIPE, DEVNULL
     import errno
     result = {'Codename': 'sid', 'Distributor ID': 'Debian',
               'Description': 'Debian GNU/Linux unstable (sid)',
               'Release': 'unstable'}
     try:
-        out = Popen(['lsb_release', '-idrc'], stdout=PIPE).communicate()[0]
+        out = Popen(['lsb_release', '-idrc'], stdout=PIPE, stderr=DEVNULL).communicate()[0]
         # Convert to unicode string, needed for Python 3.1
         out = out.decode("utf-8")
         result.update(l.split(":\t") for l in out.split("\n") if ':\t' in l)
Download as text