From: Zac Medico Date: Fri, 27 Feb 2009 05:23:37 +0000 (-0000) Subject: Use Popen.communicate() to avoid a potential deadlock. X-Git-Tag: v2.2_rc24~86 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cde01d3ff9300752bfb635ad9c77436ccd251f57;p=portage.git Use Popen.communicate() to avoid a potential deadlock. svn path=/main/trunk/; revision=12729 --- diff --git a/pym/portage/sets/shell.py b/pym/portage/sets/shell.py index 8114b5133..43a8fe02f 100644 --- a/pym/portage/sets/shell.py +++ b/pym/portage/sets/shell.py @@ -33,9 +33,9 @@ class CommandOutputSet(PackageSet): def load(self): pipe = subprocess.Popen(self._command, stdout=subprocess.PIPE, shell=True) + stdout, stderr = pipe.communicate() if pipe.wait() == os.EX_OK: - text = unicode(pipe.stdout.read(), errors='replace') - self._setAtoms(text.splitlines()) + self._setAtoms(unicode(stdout, errors='replace').splitlines()) def singleBuilder(self, options, settings, trees): if not "command" in options: