MCPcopy Index your code
hub / github.com/RustPython/RustPython / _read_input

Method _read_input

Lib/_pyrepl/windows_console.py:374–387  ·  view source on GitHub ↗
(self, block: bool = True)

Source from the content-addressed store, hash-verified

372 return info.srWindow.Bottom # type: ignore[no-any-return]
373
374 def _read_input(self, block: bool = True) -> INPUT_RECORD | None:
375 if not block:
376 events = DWORD()
377 if not GetNumberOfConsoleInputEvents(InHandle, events):
378 raise WinError(GetLastError())
379 if not events.value:
380 return None
381
382 rec = INPUT_RECORD()
383 read = DWORD()
384 if not ReadConsoleInput(InHandle, rec, 1, read):
385 raise WinError(GetLastError())
386
387 return rec
388
389 def get_event(self, block: bool = True) -> Event | None:
390 """Return an Event instance. Returns None if |block| is false

Callers 1

get_eventMethod · 0.95

Calls 3

WinErrorFunction · 0.90
INPUT_RECORDClass · 0.85
GetLastErrorFunction · 0.70

Tested by

no test coverage detected