#NEWLINE# def _inner_acquire( self , blocking , timeout = None ) : #NEWLINE# #INDENT# 'Inner loop that runs from the top anytime a command hits a\n        retryable Zookeeper exception.' #NEWLINE# self . _session_expired = False #NEWLINE# self . client . add_listener ( self . _watch_session ) #NEWLINE# if ( not self . assured_path ) : #NEWLINE# #INDENT# self . _ensure_path ( ) #NEWLINE# #UNINDENT# if self . client . exists ( self . create_path ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# with self . client . Lock ( self . lock_path , blocking . data ) : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# self . wake_event . clear ( ) #NEWLINE# if self . _get_lease ( ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# if blocking : #NEWLINE# #INDENT# self . wake_event . wait ( timeout ) #NEWLINE# if ( not self . wake_event . isSet ( ) ) : #NEWLINE# #INDENT# raise LockTimeout ( ( 'Failed to acquire semaphore on %s after %s seconds' % ( self . path , timeout ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . client . get_children ( self . path , self . _get_lease ) #NEWLINE# return False