Wait for an event.
(self, timeout: float | None)
| 551 | return e |
| 552 | |
| 553 | def wait_for_event(self, timeout: float | None) -> bool: |
| 554 | """Wait for an event.""" |
| 555 | if timeout is None: |
| 556 | timeout = INFINITE |
| 557 | else: |
| 558 | timeout = int(timeout) |
| 559 | ret = WaitForSingleObject(InHandle, timeout) |
| 560 | if ret == WAIT_FAILED: |
| 561 | raise WinError(get_last_error()) |
| 562 | elif ret == WAIT_TIMEOUT: |
| 563 | return False |
| 564 | return True |
| 565 | |
| 566 | def wait(self, timeout: float | None) -> bool: |
| 567 | """ |
no test coverage detected