in dcrpm/pidutil.py [0:0]
def process(pid):
# type: (int) -> t.Optional[psutil.Process]
"""
Thin wrapper around psutil.Process with exception handling, mainly for
encapsulation.
"""
try:
return psutil.Process(pid)
except psutil.NoSuchProcess:
logging.error("Pid %d does not exist or is no longer active", pid)
return None