

def get_process_exe(self):
    try:
        exe = os.readlink(('/proc/%s/exe' % self.pid))
    except (OSError, IOError):
        err = sys.exc_info()[1]
        if (err.errno == errno.ENOENT):
            if os.path.lexists(('/proc/%s/exe' % self.pid)):
                return ''
            else:
                raise NoSuchProcess(self.pid, self._process_name)
        if (err.errno in (errno.EPERM, errno.EACCES)):
            raise AccessDenied(self.pid, self._process_name)
        raise
    exe = exe.replace('\x00', '')
    if (exe.endswith(' (deleted)') and (not os.path.exists(exe))):
        exe = exe[:(- 10)]
    return exe

dataset/ETHPy150Open packages/psutil/psutil/_pslinux.py Process.get_process_exe/original