[bitbake-devel] [PATCH 2/2] replace os.popen with subprocess.Popen

Chris Larson clarson at kergoth.com
Mon May 14 13:59:24 UTC 2012


On Mon, May 14, 2012 at 1:07 AM, Robert Yang <liezhi.yang at windriver.com> wrote:
>     def popen_read(self, cmd):
> -        return os.popen("%s 2>/dev/null" % cmd).read().strip()
> +        return subprocess.Popen("%s 2>/dev/null" % cmd, shell=True, stdout=subprocess.PIPE).stdout.read().strip()

The 2>/dev/null is irrelevant when we're only inspecting the stdout
anyway. Also, we already have wrappers around Popen for convenience in
the bb.process python module.
-- 
Christopher Larson




More information about the bitbake-devel mailing list