bare excepts

John Arbash Meinel john at arbash-meinel.com
Tue Jan 3 05:35:25 GMT 2006


Robert Collins wrote:
> What do you guys think of a test for bare excepts? I just spent ~ 30
> minutes tracking down a bug that was hidden by:
> 
>             try:
>                 path = self._basis_inventory_name(old_revision)
>                 path = self.branch._rel_controlfilename(path)
>                 self.branch._transport.delete(path)
>             except:
>                 pass
> 
> 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.)
> 
> Rob
> 

Seems +1 to me.
I know there is a specific reason to do so in transport/sftp.py to
handle cleanup.
But having a test where people need to be sure that they are doing the
right thing is reasonable.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060102/e9e37cb2/attachment.pgp 


More information about the bazaar mailing list