-=[ Mr. Bumblebee ]=-
_Indonesia_
σ
ξ:οNc @@ s d Z d d l m Z d d l m Z d d l Z d d l m Z m Z d Z d Z
d Z d e f d
YZ
d e
f d YZ d
Z d S( s Helpers for managing cleanup functions and the errors they might raise.
The usual way to run cleanup code in Python is::
try:
do_something()
finally:
cleanup_something()
However if both `do_something` and `cleanup_something` raise an exception
Python will forget the original exception and propagate the one from
cleanup_something. Unfortunately, this is almost always much less useful than
the original exception.
If you want to be certain that the first, and only the first, error is raised,
then use::
operation = OperationWithCleanups(do_something)
operation.add_cleanup(cleanup_something)
operation.run_simple()
This is more inconvenient (because you need to make every try block a
function), but will ensure that the first error encountered is the one raised,
while also ensuring all cleanups are run. See OperationWithCleanups for more
details.
i ( t absolute_import( t dequeN( t debugt tracec C@ s= t j d t j d t j k r9 t j d | n d S( Ns Cleanup failed:t cleanups bzr: warning: Cleanup failed: %s( R t muttert log_exception_quietlyR t debug_flagst warning( t exc( ( s2 /usr/lib/python2.7/dist-packages/bzrlib/cleanup.pyt _log_cleanup_error5 s
c O@ sI y | | | Wn1 t k
r' n t k
rD } t | t SXt S( s Run func(*args, **kwargs), logging but not propagating any error it
raises.
:returns: True if func raised no errors, else False.
( t KeyboardInterruptt ExceptionR
t Falset True( t funct argst kwargsR ( ( s2 /usr/lib/python2.7/dist-packages/bzrlib/cleanup.pyt _run_cleanup<