#!/usr/bin/env python

import fcntl, os, pty
master, slave = pty.openpty()
os.close(slave)
fd_flags = fcntl.fcntl(master, fcntl.F_GETFL)
fcntl.fcntl(master, fcntl.F_SETFL, fd_flags | os.O_NONBLOCK)
