(fun)
return wrapper
Decorator which raises NoSuchProcess in case a process is no
    longer running or its PID has been reused.
Decorator which raises NoSuchProcess in case a process is no
    longer running or its PID has been reused.
Decorator which raises NoSuchProcess in case a process is no longer running or its PID has been reused .
def _assert_pid_not_reused(fun):
    """Decorator which raises NoSuchProcess in case a process is no
    longer running or its PID has been reused.
    """
    @functools.wraps(fun)
    def wrapper(self, *args, **kwargs):
        if not self.is_running():
            raise NoSuchProcess(self.pid, self._name)
        return fun(self, *args, **kwargs)
    return wrapper
def _assert_pid_not_reused ( fun ) : @ functools . wraps ( fun ) def wrapper ( self , * args , * * kwargs ) : if not self . is_running ( ) : raise NoSuchProcess ( self . pid , self . _name ) return fun ( self , * args , * * kwargs ) return wrapper