def pty_normalize_newlines(fd):
import termios as T<EOL>attrs = T.tcgetattr(fd)<EOL>attrs[<NUM_LIT:1>] &= ~(T.ONLCR | T.OPOST)<EOL>T.tcsetattr(fd, T.TCSANOW, attrs)<EOL>
r"""
    Twiddle the tty flags such that \n won't get munged to \r\n.
    Details:
        https://docs.python.org/2/library/termios.html
        http://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_chapter/libc_17.html#SEC362