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

Robert Yang liezhi.yang at windriver.com
Tue May 15 06:49:57 UTC 2012



On 05/14/2012 09:59 PM, Chris Larson wrote:
> 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.

Thanks, I will remove the 2>/dev/null and use:

from bb.process import Popen

to simplify the code, I will send the V2 sooner.

// Robert





More information about the bitbake-devel mailing list