#NEWLINE# def valid_lock( self ) : #NEWLINE# #INDENT# '\n        See if the lock exists and is left over from an old process.\n        ' #NEWLINE# lock_pid = self . get_lock_pid ( ) #NEWLINE# if ( lock_pid is None ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( self . _pid == lock_pid ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . kill ( lock_pid , 0 ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# self . release ( ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True