Your IP : 216.73.216.196


Current Path : /opt/alt/python27/lib/python2.7/site-packages/ptyprocess/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/ptyprocess/_fork_pty.pyc

�
�i�Vc@sVdZddlZddlZddlmZmZmZmZd�Zd�Z	dS(s<Substitute for the forkpty system call, to support Solaris.
i����N(tSTDIN_FILENOt
STDOUT_FILENOt
STDERR_FILENOtCHILDcCs�tj�\}}|dks*|dkr9td��ntj�}|tkr�tj|�t|�tj|t�tj|t	�tj|t
�n
tj|�||fS(s�This implements a substitute for the forkpty system call. This
    should be more portable than the pty.fork() function. Specifically,
    this should work on Solaris.

    Modified 10.06.05 by Geoff Marshall: Implemented __fork_pty() method to
    resolve the issue with Python's pty.fork() not supporting Solaris,
    particularly ssh. Based on patch to posixmodule.c authored by Noah
    Spurrier::

        http://mail.python.org/pipermail/python-dev/2003-May/035281.html

    isos.openpty() failed(tostopenptytOSErrortforkRtclosetpty_make_controlling_ttytdup2RRR(t	parent_fdtchild_fdtpid((sE/opt/alt/python27/lib/python2.7/site-packages/ptyprocess/_fork_pty.pytfork_ptys


cCs#tj|�}y-tjdtjtjB�}tj|�Wn+tk
ri}|jtjkrj�qjnXtj	�y9tjdtjtjB�}tj|�t
d��Wn+tk
r�}|jtjkr��q�nXtj|tj�}tj|�tjdtj�}tj|�dS(s�This makes the pseudo-terminal the controlling tty. This should be
    more portable than the pty.fork() function. Specifically, this should
    work on Solaris. s/dev/ttys(OSError of errno.ENXIO should be raised.N(RtttynametopentO_RDWRtO_NOCTTYRRterrnotENXIOtsetsidtExceptionPexpecttO_WRONLY(ttty_fdt
child_nametfdterr((sE/opt/alt/python27/lib/python2.7/site-packages/ptyprocess/_fork_pty.pyR	*s&




(
t__doc__RRtptyRRRRRR	(((sE/opt/alt/python27/lib/python2.7/site-packages/ptyprocess/_fork_pty.pyt<module>s
"	"