mirror of https://github.com/python/cpython
[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 4e36dd7d87
)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
de51ee0c23
commit
62572f10aa
|
@ -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:
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Fix a bug that was preventing the REPL to correctly respect the history when
|
||||
an input hook was set. Patch by Pablo Galindo
|
Loading…
Reference in New Issue