File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -416,12 +416,8 @@ def _getscrollbacksize(self) -> int:
416416 return info .srWindow .Bottom # type: ignore[no-any-return]
417417
418418 def _read_input (self , block : bool = True ) -> INPUT_RECORD | None :
419- if not block :
420- ret = WaitForSingleObject (InHandle , 0 )
421- if ret == WAIT_FAILED :
422- raise WinError (get_last_error ())
423- elif ret == WAIT_TIMEOUT :
424- return None
419+ if not block and not self .wait (timeout = 0 ):
420+ return None
425421
426422 rec = INPUT_RECORD ()
427423 read = DWORD ()
@@ -536,6 +532,9 @@ def wait(self, timeout: float | None) -> bool:
536532 ret = WaitForSingleObject (InHandle , timeout )
537533 if ret == WAIT_FAILED :
538534 raise WinError (get_last_error ())
535+ elif ret == WAIT_TIMEOUT :
536+ return False
537+ return True
539538
540539 def repaint (self ) -> None :
541540 raise NotImplementedError ("No repaint support" )
You can’t perform that action at this time.
0 commit comments