There was an error while loading. Please reload this page.
1 parent 3d1da66 commit 4098e3dCopy full SHA for 4098e3d
1 file changed
Lib/_pyrepl/windows_console.py
@@ -416,12 +416,8 @@ def _getscrollbacksize(self) -> int:
416
return info.srWindow.Bottom # type: ignore[no-any-return]
417
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
+ if not block and not self.wait(timeout=0):
+ return None
425
426
rec = INPUT_RECORD()
427
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:
+ return False
+ return True
539
540
def repaint(self) -> None:
541
raise NotImplementedError("No repaint support")
0 commit comments