bare excepts

Martin Pool mbp at sourcefrog.net
Wed Jan 4 01:08:36 GMT 2006


On Tue, 2006-01-03 at 19:34 +1100, Robert Collins wrote:
> On Tue, 2006-01-03 at 01:28 -0500, Aaron Bentley wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Robert Collins wrote:
> > | I'd be happy to extend my code-practices tests to check for:
> > | except:
> > | except Exception[ ,].*
> > | What do you think? (They are persistent little buggers, keep coming
> > | back.)
> > 
> > I think we'd need a way to flag some of the second type as legit.  And
> > there's a risk of improper flagging, then.  But on the whole, sure.
> 
> I'll put in a counter - which we can change as needed - to accomodate
> the aggregate legit ones. That said, I *still* have never seen one.

Yes, +1 on grepping for it.  A counter seems a bit likely to let them
slip through - maybe allow the form

  try:
  except:    # WARNING BARE EXCEPT

if the comment is there with those exact words.

-- 
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060104/29a5f731/attachment.pgp 


More information about the bazaar mailing list