[RFC/MERGE][#243391] _run_and_cleanup helper (alternative to try/finally)

Michael Hudson michael.hudson at canonical.com
Wed Oct 8 07:21:27 BST 2008


Andrew Bennetts wrote:

> So, feedback sought.

I guess it's not the most practical thought, but it does seem to me that
this is a neat use case for Python 2.5's 'with' blocks -- you ought to
be able to define an object such that:

   with write_locked(branch):
       ...

DTRT.  A thought for the future, perhaps?

Cheers,
mwh



More information about the bazaar mailing list