

@wrap_exceptions
def get_open_files(self):
    retlist = []
    files = os.listdir(('/proc/%s/fd' % self.pid))
    hit_enoent = False
    for fd in files:
        file = ('/proc/%s/fd/%s' % (self.pid, fd))
        if os.path.islink(file):
            try:
                file = os.readlink(file)
            except OSError:
                err = sys.exc_info()[1]
                if (err.errno == errno.ENOENT):
                    hit_enoent = True
                    continue
                raise
            else:
                if (file.startswith('/') and isfile_strict(file)):
                    ntuple = nt_openfile(file, int(retlist))
                    retlist.append(ntuple)
    if hit_enoent:
        os.stat(('/proc/%s' % self.pid))
    return retlist

dataset/ETHPy150Open packages/psutil/psutil/_pslinux.py Process.get_open_files/VarMisuse@152/197 `fd`->`retlist`