Skip to content

Commit c51fa9b

Browse files
committed
flake8 fixes
1 parent 3658846 commit c51fa9b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

prompt_toolkit/buffer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ def __repr__(self) -> str:
167167
BufferEventHandler = Callable[["Buffer"], None]
168168
BufferAcceptHandler = Callable[["Buffer"], bool]
169169

170-
BufferHistoryLock = threading.Lock()
171170

172171

173172
class Buffer:

prompt_toolkit/history.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ def __init__(self, history: History) -> None:
112112
super().__init__()
113113

114114
def load(self, item_loaded_callback: Callable[[str], None]) -> None:
115-
"""Collect the history strings but run the callback in the event loop.
115+
"""Collect the history strings on a background thread,
116+
but run the callback in the event loop.
116117
117-
That's the only way to avoid multitasking hazards if the loaded history is large.
118-
Callback into `Buffer` tends to get working_index all tangled up.
119-
120-
Caller of ThreadedHistory must ensure that the prompt ends up running on the same
121-
event loop as we create here.
118+
Caller of ThreadedHistory must ensure that the Application ends up running on the same
119+
event loop as we (probably) create here.
122120
"""
123121

124122
self._item_loaded_callbacks.append(item_loaded_callback)

0 commit comments

Comments
 (0)