Skip to content

Commit 8e8a0ec

Browse files
try
1 parent 66f9014 commit 8e8a0ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

moler/io/raw/pty_process_unicode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ def setwinsize(self, rows: int, cols: int) -> None:
8888
if self.fd < 0:
8989
raise MolerException("Cannot resize closed pty process")
9090

91-
if hasattr(termios, "tcsetwinsize"):
91+
try:
9292
termios.tcsetwinsize(self.fd, (rows, cols))
93-
else:
93+
except AttributeError:
9494
# Fallback for Python/platforms that do not expose tcsetwinsize(). < 3.10
9595
tiocswinsz = getattr(termios, "TIOCSWINSZ", -2146929561)
9696
window_size = struct.pack("HHHH", rows, cols, 0, 0)

0 commit comments

Comments
 (0)