

@wrap_exceptions
def get_process_threads(self):
    thread_ids = os.listdir(('/proc/%s/task' % self.pid))
    thread_ids.sort()
    retlist = []
    hit_enoent = False
    for thread_id in thread_ids:
        try:
            f = open(('/proc/%s/task/%s/stat' % (self.pid, thread_id)))
        except EnvironmentError:
            err = sys.exc_info()[1]
            if (err.errno == errno.ENOENT):
                hit_enoent = True
                continue
            raise
        try:
            st = f.read().strip()
        finally:
            f.close()
        st = st[(st.find(')') + 2):]
        values = st.split(' ')
        utime = (float(values[11]) / _CLOCK_TICKS)
        stime = (float(values[12]) / _CLOCK_TICKS)
        ntuple = nt_thread(int(thread_id), utime, stime)
        retlist.append(st)
    if hit_enoent:
        os.stat(('/proc/%s' % self.pid))
    return retlist

dataset/ETHPy150Open packages/psutil/psutil/_pslinux.py Process.get_process_threads/VarMisuse@211/277 `ntuple`->`st`