[OE-core] [PATCH] class/lib: Fix up various file access methods

Richard Purdie richard.purdie at linuxfoundation.org
Thu May 9 16:43:21 UTC 2013


On Thu, 2013-05-09 at 18:19 +0200, Martin Jansa wrote:
> On Thu, May 09, 2013 at 05:05:58PM +0100, Richard Purdie wrote:
> > There are various bits of cruft that have built up around our file accesses. This patch
> > cleans some of them up, specifically:
> > 
> >  * Remove pointless "from __builtin__ import file"
> >  * Use open(), not file()
> >  * Wrap file usage in a with container to ensure files are closed
> >  * Add missing .close() calls in some cases
> > 
> > Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
> > ---
> > diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass
> > index 63ba087..c30d1cb 100644
> > --- a/meta/classes/imagetest-qemu.bbclass
> > +++ b/meta/classes/imagetest-qemu.bbclass
> > @@ -146,6 +146,7 @@ def qemuimagetest_main(d):
> >                         if not os.path.isfile(fulltestcase):
> >                              raise bb.build.FuncFailed("Testcase %s not found" % fulltestcase)
> >                         list.append((item, casefile, fulltestcase))
> > +                    f.close()
> 
> indentation looks wrong and the same a line above "raise.."

Its an existing issue with the file, this patch is correct but I've sent
out a separate patch fixing it.

Cheers,

Richard





More information about the Openembedded-core mailing list