@ -147,6 +147,8 @@ LINUX_TIOCGPTN = _ioctl_cast(2147767344)
LINUX_TIOCSPTLCK = _ioctl_cast ( 1074025521 )
LINUX_TIOCSPTLCK = _ioctl_cast ( 1074025521 )
IS_LINUX = os . uname ( ) [ 0 ] == ' Linux '
IS_LINUX = os . uname ( ) [ 0 ] == ' Linux '
IS_SOLARIS = os . uname ( ) [ 0 ] == ' SunOS '
SIGNAL_BY_NUM = dict (
SIGNAL_BY_NUM = dict (
( getattr ( signal , name ) , name )
( getattr ( signal , name ) , name )
@ -411,7 +413,7 @@ def _acquire_controlling_tty():
# On Linux, the controlling tty becomes the first tty opened by a
# On Linux, the controlling tty becomes the first tty opened by a
# process lacking any prior tty.
# process lacking any prior tty.
os . close ( os . open ( os . ttyname ( 2 ) , os . O_RDWR ) )
os . close ( os . open ( os . ttyname ( 2 ) , os . O_RDWR ) )
if hasattr ( termios , ' TIOCSCTTY ' ) and not mitogen . core . IS_WSL :
if hasattr ( termios , ' TIOCSCTTY ' ) and not mitogen . core . IS_WSL and not IS_SOLARIS :
# #550: prehistoric WSL does not like TIOCSCTTY.
# #550: prehistoric WSL does not like TIOCSCTTY.
# On BSD an explicit ioctl is required. For some inexplicable reason,
# On BSD an explicit ioctl is required. For some inexplicable reason,
# Python 2.6 on Travis also requires it.
# Python 2.6 on Travis also requires it.
@ -479,6 +481,7 @@ def openpty():
master_fp = os . fdopen ( master_fd , ' r+b ' , 0 )
master_fp = os . fdopen ( master_fd , ' r+b ' , 0 )
slave_fp = os . fdopen ( slave_fd , ' r+b ' , 0 )
slave_fp = os . fdopen ( slave_fd , ' r+b ' , 0 )
if not IS_SOLARIS :
disable_echo ( master_fd )
disable_echo ( master_fd )
disable_echo ( slave_fd )
disable_echo ( slave_fd )
mitogen . core . set_block ( slave_fd )
mitogen . core . set_block ( slave_fd )