Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9eccd9c

Browse files
authored
Merge pull request #2390 from gaige/main
Switch pty use to fix solaris
2 parents 3cdc6c9 + a84136d commit 9eccd9c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pre_commit/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ def __enter__(self) -> Pty:
168168
self.r, self.w = openpty()
169169

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

176176
return self
177177

0 commit comments

Comments
 (0)