All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael 'Mickey' Lauer <mickey@vanille-media.de>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [PATCH] packaged-staging.bbclass: use 'os.unlink()' instead of spawning 'rm'
Date: Wed, 17 Mar 2010 18:39:07 +0100	[thread overview]
Message-ID: <1268847547.3211.11.camel@andromeda> (raw)
In-Reply-To: <1268845536.29482.4.camel@trini-m4400>

> > +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:





  reply	other threads:[~2010-03-17 17:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 12:23 [PATCH] packaged-staging.bbclass: use 'os.unlink()' instead of spawning 'rm' Enrico Scholz
2010-03-17  2:05 ` Tom Rini
2010-03-17 10:00   ` Enrico Scholz
2010-03-17 17:05 ` Tom Rini
2010-03-17 17:39   ` Michael 'Mickey' Lauer [this message]
2010-03-17 17:48     ` Tom Rini
2010-03-17 18:18       ` Tom Rini
2010-04-14  9:55 ` [PATCH v2] " Enrico Scholz
2010-04-14 12:48   ` Sebastian Spaeth
2010-04-14 13:21     ` Enrico Scholz
2010-04-14 14:52   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268847547.3211.11.camel@andromeda \
    --to=mickey@vanille-media.de \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.