This commit is contained in:
Kovid Goyal
2021-10-31 14:06:02 +05:30
parent b1c0398bba
commit 22673ebd90

View File

@@ -455,6 +455,8 @@ class TTYIO:
close_tty(self.tty_fd, self.original_termios)
def wait_till_read_available(self) -> bool:
if self.read_with_timeout:
raise ValueError('Cannot wait when TTY is set to read with timeout')
import select
rd = select.select([self.tty_fd], [], [])[0]
return bool(rd)