Skip to content

[3.13] gh-121497: Make Pyrepl respect correctly the history with input hook set (GH-121498) #121703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading