util: Ignore errors in clear_hupcl (allows OSX to run)

Signed-off-by: Lyle Cheatham <hello@lylecheatham.com>
This commit is contained in:
LyleCheatham authored and Kevin O'Connor committed 2019-05-20 16:49:42 -04:00
1 parent f7cb0875f4
commit 1235972b77
1 file changed
+4 -1
+4 -1
View File
@@ -20,7 +20,10 @@ def set_nonblock(fd):
def clear_hupcl(fd):
attrs = termios.tcgetattr(fd)
attrs[2] = attrs[2] & ~termios.HUPCL
termios.tcsetattr(fd, termios.TCSADRAIN, attrs)
try:
termios.tcsetattr(fd, termios.TCSADRAIN, attrs)
except termios.error:
pass
# Support for creating a pseudo-tty for emulating a serial port
def create_pty(ptyname):