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>
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:
raise
else:
break
- if not block:
- break
return self.event_queue.get()
def wait(self, timeout: float | None = None) -> bool:
--- /dev/null
+Fix a bug that was preventing the REPL to correctly respect the history when
+an input hook was set. Patch by Pablo Galindo