diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-07-13 14:28:49 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-13 14:28:49 (GMT) |
| commit | 62572f10aa3044e3a5b0a1a3af9a3c3286a61ddf (patch) | |
| tree | 672b2b0a7d2a116af976984cd06fbb6fe27756ca /Lib/_pyrepl/unix_console.py | |
| parent | de51ee0c2351124181e61613167a1c468380ceaa (diff) | |
| download | cpython-62572f10aa3044e3a5b0a1a3af9a3c3286a61ddf.zip cpython-62572f10aa3044e3a5b0a1a3af9a3c3286a61ddf.tar.gz cpython-62572f10aa3044e3a5b0a1a3af9a3c3286a61ddf.tar.bz2 | |
[3.13] gh-121497: Make Pyrepl respect correctly the history with input hook set (GH-121498) (#121703)
gh-121497: Make Pyrepl respect correctly the history with input hook set (GH-121498)
(cherry picked from commit 4e36dd7d87eb0f1bd1ecd53e368c16a5f75967a0)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Lib/_pyrepl/unix_console.py')
| -rw-r--r-- | Lib/_pyrepl/unix_console.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_pyrepl/unix_console.py b/Lib/_pyrepl/unix_console.py index c4dedd9..18b2bba 100644 --- a/Lib/_pyrepl/unix_console.py +++ b/Lib/_pyrepl/unix_console.py @@ -383,6 +383,8 @@ class UnixConsole(Console): Returns: - Event: Event object from the event queue. """ + if not block and not self.wait(timeout=0): + return None while self.event_queue.empty(): while True: try: @@ -397,8 +399,6 @@ class UnixConsole(Console): raise else: break - if not block: - break return self.event_queue.get() def wait(self, timeout: float | None = None) -> bool: |
