mirror of
https://github.com/python/cpython.git
synced 2025-09-23 00:43:12 +00:00
gh-121497: Make Pyrepl respect correctly the history with input hook set (#121498)
This commit is contained in:
parent
dc03ce797a
commit
4e36dd7d87
2 changed files with 4 additions and 2 deletions
|
@ -383,6 +383,8 @@ class UnixConsole(Console):
|
||||||
Returns:
|
Returns:
|
||||||
- Event: Event object from the event queue.
|
- Event: Event object from the event queue.
|
||||||
"""
|
"""
|
||||||
|
if not block and not self.wait(timeout=0):
|
||||||
|
return None
|
||||||
while self.event_queue.empty():
|
while self.event_queue.empty():
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@ -397,8 +399,6 @@ class UnixConsole(Console):
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
if not block:
|
|
||||||
break
|
|
||||||
return self.event_queue.get()
|
return self.event_queue.get()
|
||||||
|
|
||||||
def wait(self, timeout: float | None = None) -> bool:
|
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…
Add table
Add a link
Reference in a new issue