

@wrap_exceptions
def get_process_terminal(self):
    f = open(('/proc/%s/stat' % self.pid))
    try:
        tty_nr = int(f.read().split(' ')[6])
    finally:
        f.close()
    try:
        return _TERMINAL_MAP[tty_nr]
    except KeyError:
        return None

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