diff --git a/Lib/test/test_termios.py b/Lib/test/test_termios.py index cbc922bb3e31ca..91c92c3f2e6ec2 100644 --- a/Lib/test/test_termios.py +++ b/Lib/test/test_termios.py @@ -169,6 +169,9 @@ def test_tcflow(self): termios.tcflow(self.fd, termios.TCOON) termios.tcflow(self.fd, termios.TCIOFF) termios.tcflow(self.fd, termios.TCION) + # Discard the transmitted STOP and START characters, + # otherwise closing the pseudo-terminal can block. + termios.tcflush(self.fd, termios.TCOFLUSH) def test_tcflow_errors(self): self.assertRaisesTermiosError(errno.EINVAL, termios.tcflow, self.fd, -1)