(self)
Return whether this process is running.
        It also checks if PID has been reused by another process in
        which case return False.
Return whether this process is running.
        It also checks if PID has been reused by another process in
        which case return False.
Return whether this process is running . It also checks if PID has been reused by another process in which case return False .
def is_running(self):
        """Return whether this process is running.
        It also checks if PID has been reused by another process in
        which case return False.
        """
        if self._gone:
            return False
        try:
            # Checking if PID is alive is not enough as the PID might
            # have been reused by another process: we also want to
            # verify process identity.
            # Process identity / uniqueness over time is guaranteed by
            # (PID + creation time) and that is verified in __eq__.
            return self == Process(self.pid)
        except NoSuchProcess:
            self._gone = True
            return False
def is_running ( self ) : if self . _gone : return False try : # Checking if PID is alive is not enough as the PID might # have been reused by another process: we also want to # verify process identity. # Process identity / uniqueness over time is guaranteed by # (PID + creation time) and that is verified in __eq__. return self == Process ( self . pid ) except NoSuchProcess : self . _gone = True return False