mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
[3.13] gh-119842: Honor PyOS_InputHook in the new REPL (GH-119843) (GH-120066)
(cherry picked from commit d9095194dd
)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
This commit is contained in:
parent
93b95e91fa
commit
eea45ea213
8 changed files with 144 additions and 11 deletions
|
@ -33,6 +33,7 @@ TYPE_CHECKING = False
|
|||
|
||||
if TYPE_CHECKING:
|
||||
from typing import IO
|
||||
from typing import Callable
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -134,8 +135,15 @@ class Console(ABC):
|
|||
...
|
||||
|
||||
@abstractmethod
|
||||
def wait(self) -> None:
|
||||
"""Wait for an event."""
|
||||
def wait(self, timeout: float | None) -> bool:
|
||||
"""Wait for an event. The return value is True if an event is
|
||||
available, False if the timeout has been reached. If timeout is
|
||||
None, wait forever. The timeout is in milliseconds."""
|
||||
...
|
||||
|
||||
@property
|
||||
def input_hook(self) -> Callable[[], int] | None:
|
||||
"""Returns the current input hook."""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue