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

Robert Yang liezhi.yang at windriver.com
Wed May 16 01:29:02 UTC 2012



On 05/15/2012 10:43 PM, Chris Larson wrote:
> 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

Thanks, the bb.process.run() would be better, I will send the V3 sooner.

// Robert

> Popen, no? Once we require python 2.7, we can use
> subprocess.check_output() instead, of course.




More information about the bitbake-devel mailing list