From 00dc02427153cf046ae072f1f6dee4dab2e643fd Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 29 May 2010 21:21:56 +0100 Subject: [PATCH] Discard stderr from "dpkg-query -W" Avoids "No packages found matching" warning message. --- zeroinstall/injector/distro.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zeroinstall/injector/distro.py b/zeroinstall/injector/distro.py index 20ab984..e6f92fd 100644 --- a/zeroinstall/injector/distro.py +++ b/zeroinstall/injector/distro.py @@ -277,8 +277,10 @@ class DebianDistribution(Distribution): self.apt_cache = Cache('apt-cache-cache', pkgcache, 3) def _query_installed_package(self, package): + null = os.open('/dev/null', os.O_WRONLY) child = subprocess.Popen(["dpkg-query", "-W", "--showformat=${Version}\t${Architecture}\t${Status}\n", "--", package], - stdout = subprocess.PIPE) + stdout = subprocess.PIPE, stderr = null) + os.close(null) stdout, stderr = child.communicate() child.wait() for line in stdout.split('\n'): -- 2.11.4.GIT