bare excepts

John Arbash Meinel john at arbash-meinel.com
Tue Jan 3 14:06:53 GMT 2006


Robert Collins wrote:
> On Mon, 2006-01-02 at 23:35 -0600, John Arbash Meinel wrote:
> 
>>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.
> 
> 
> I've peeked at sftp.py - I think that try:finally:  would do there - as
> python will take care of raising the exception (as long as we dont raise
> a *new* one out of the finally clause.
> 
> Rob

Except we only run that code when an exception happens, because we are
deleting the file that we uploaded.
I guess we could do a try/finally with a boolean success so you know
whether to clean up the original, or the newly uploaded file.

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/20060103/3a63ddff/attachment.pgp 


More information about the bazaar mailing list