[oe] [PATCH] packaged-staging.bbclass: use 'os.unlink()' instead of spawning 'rm'

Michael 'Mickey' Lauer mickey at vanille-media.de
Wed Mar 17 17:39:07 UTC 2010


> > +def _package_unlink (f):
> > +    import os
> > +    try:
> > +	os.unlink(f)
> > +	return True
> > +    except:
> > +	return False
> > +

While it won't hurt in this particular case, a catch-all 'except'
usually is frowned upon. Better catch specific errors and let other
errors be handled by the upper layers. I'd recommend catching IOError
only here.

:M:






More information about the Openembedded-devel mailing list