On Mon, May 31, 2010 at 12:13 PM, Bernhard Reutner-Fischer <
[email protected]> wrote:

> On Mon, May 31, 2010 at 01:07:36PM -0400, Michael Smith wrote:
> >Bernhard Reutner-Fischer wrote:
> >>--- a/lib/bb/cache.py
> >>+++ b/lib/bb/cache.py
> >>@@ -64,10 +64,11 @@ class Cache:
> >>-        try:
> >>-            os.stat( self.cachedir )
> >>-        except OSError:
> >>-            bb.mkdirhier( self.cachedir )
> >>+        if not os.path.isdir(self.cachedir):
> >>+            try:
> >>+                bb.mkdirhier( self.cachedir )
> >>+            except:
> >>+                raise
> >
> >Hi Bernhard,
> >
> >Is that try/except/raise necessary?
>
> probably not but, what if mkdir() fails?
>

That block does absolutely nothing.  It catches any exception and raises it
again -- no different than doing nothing, letting any exception raised by
mkdirhier.  Also, that block is unnecessary if you're going to use
mkdirhier.  mkdirhier creates a dir and silently does nothing if the dir
already exists, so your isdir isn't necessary, unless I'm missing something.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to