Skip to content

Commit

Permalink
Merge pull request #2390 from gaige/main
Browse files Browse the repository at this point in the history
Switch pty use to fix solaris
  • Loading branch information
asottile committed May 14, 2022
2 parents 3cdc6c9 + a84136d commit 9eccd9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pre_commit/util.py
Expand Up @@ -168,10 +168,10 @@ def __enter__(self) -> Pty:
self.r, self.w = openpty()

# tty flags normally change \n to \r\n
attrs = termios.tcgetattr(self.r)
attrs = termios.tcgetattr(self.w)
assert isinstance(attrs[1], int)
attrs[1] &= ~(termios.ONLCR | termios.OPOST)
termios.tcsetattr(self.r, termios.TCSANOW, attrs)
termios.tcsetattr(self.w, termios.TCSANOW, attrs)

return self

Expand Down

0 comments on commit 9eccd9c

Please sign in to comment.