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

Chris Larson clarson at kergoth.com
Tue May 15 14:43:04 UTC 2012


On Tue, May 15, 2012 at 2:53 AM, Robert Yang <liezhi.yang at windriver.com> wrote:
> -        p4file = os.popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot))
> +        p4file = Popen("%s%s changes -m 1 %s" % (p4cmd, p4opt, depot)).stdout
>         cset = p4file.readline().strip()

When all that's being done is reading the output of the command, I'd
think bb.process.run() would do the job, rather than manually using
Popen, no? Once we require python 2.7, we can use
subprocess.check_output() instead, of course.
-- 
Christopher Larson




More information about the bitbake-devel mailing list