#NEWLINE# def incr( self , key , delta = 1 , version = None ) : #NEWLINE# #INDENT# value = self . get ( key , version = version ) #NEWLINE# if ( value is None ) : #NEWLINE# #INDENT# raise ValueError ( ( "Key '%s' not found" % key ) ) #NEWLINE# #UNINDENT# new_value = ( value + delta ) #NEWLINE# key = self . make_key ( key , version = version ) #NEWLINE# with self . _lock . writer ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# pickled = pickle . dumps ( new_value , pickle . HIGHEST_PROTOCOL ) #NEWLINE# self . _cache [ key ] = pickled #NEWLINE# #UNINDENT# except pickle . PickleError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# return new_value