def popen_nonblock(*args, **kwargs):
proc = popen_sp(*args, **kwargs)<EOL>if proc.stdin:<EOL><INDENT>proc.stdin = pipebuf.NonBlockBufferedWriter(proc.stdin)<EOL><DEDENT>if proc.stdout:<EOL><INDENT>proc.stdout = pipebuf.NonBlockBufferedReader(proc.stdout)<EOL><DEDENT>if proc.stderr:<EOL><INDENT>proc.stderr = pipebuf.NonBlockBufferedReader(proc.stderr)<EOL><DEDENT>return proc<EOL>
Create a process in the same way as popen_sp, but patch the file
descriptors so they can be accessed from Python/gevent
in a non-blocking manner.