issue #275: parent: use TIOCSCTTY on Linux too.

This appears to be harmless, except for Python 2.6 on Linux/Travis,
where for some reason (some stdlib change?) simply opening the TTY is
insufficient.
pull/287/head
David Wilson 8 years ago
parent 83617ad192
commit fbd5837cf2

@ -189,8 +189,9 @@ 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 sys.platform.startswith('freebsd') or sys.platform == 'darwin': if hasattr(termios, 'TIOCSCTTY'):
# On BSD an explicit ioctl is required. # On BSD an explicit ioctl is required. For some inexplicable reason,
# Python 2.6 on Travis also requires it.
fcntl.ioctl(2, termios.TIOCSCTTY) fcntl.ioctl(2, termios.TIOCSCTTY)

Loading…
Cancel
Save