File tree 1 file changed +5
-6
lines changed
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:
416
416
return info .srWindow .Bottom # type: ignore[no-any-return]
417
417
418
418
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
425
421
426
422
rec = INPUT_RECORD ()
427
423
read = DWORD ()
@@ -536,6 +532,9 @@ def wait(self, timeout: float | None) -> bool:
536
532
ret = WaitForSingleObject (InHandle , timeout )
537
533
if ret == WAIT_FAILED :
538
534
raise WinError (get_last_error ())
535
+ elif ret == WAIT_TIMEOUT :
536
+ return False
537
+ return True
539
538
540
539
def repaint (self ) -> None :
541
540
raise NotImplementedError ("No repaint support" )
You can’t perform that action at this time.
0 commit comments