def set_controlling_pty(master, slave):
    os.setsid()
    os.close(master)
    for i in range(3):
        os.dup2(slave, i)
    if slave > 2:
        os.close(slave)
    os.close(os.open(os.ttyname(1), os.O_RDWR))
dataset/ETHPy150Open francelabs/datafari/cassandra/pylib/cqlshlib/test/run_cqlsh.py/set_controlling_pty/original