def read(self):
        """ Validate pidfile and make it stale if needed"""
        if not self.fname:
            return
        try:
            with open(self.fname, "r") as f:
                wpid = int(f.read() or 0)
                if wpid <= 0:
                    return
                return wpid
        except IOError:
            return
def read ( self ) : if not self . fname : return try : with open ( self . fname , "r" ) as f : wpid = int ( f . read ( ) or 0 ) if wpid <= 0 : return return wpid except IOError : return
Validate pidfile and make it stale if needed