summaryrefslogtreecommitdiffstats
path: root/pre_commit/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'pre_commit/util.py')
-rw-r--r--pre_commit/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pre_commit/util.py b/pre_commit/util.py
index 40c53e5..8c296f4 100644
--- a/pre_commit/util.py
+++ b/pre_commit/util.py
@@ -168,10 +168,10 @@ if os.name != 'nt': # pragma: win32 no cover
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