Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch pty use to fix solaris #2390

Merged
merged 1 commit into from May 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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