Skip to content

Commit

Permalink
pythongh-121497: Make Pyrepl respect correctly the history with input…
Browse files Browse the repository at this point in the history
… hook set
  • Loading branch information
pablogsal authored and serhiy-storchaka committed Jul 11, 2024
1 parent e6264b4 commit a852957
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/_pyrepl/unix_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ def get_event(self, block: bool = True) -> Event | None:
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:
Expand All @@ -397,8 +399,6 @@ def get_event(self, block: bool = True) -> Event | None:
raise
else:
break
if not block:
break
return self.event_queue.get()

def wait(self, timeout: float | None = None) -> bool:
Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a852957

Please sign in to comment.