Skip to content

Commit 01fb11f

Browse files
Fix progress_dialog shortcut and examples/dialogs/progress_dialog.py (#2033)
1 parent 8566f9b commit 01fb11f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/prompt_toolkit/shortcuts/dialogs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ def progress_dialog(
264264
:param run_callback: A function that receives as input a `set_percentage`
265265
function and it does the work.
266266
"""
267-
loop = get_running_loop()
268267
progressbar = ProgressBar()
269268
text_area = TextArea(
270269
focusable=False,
@@ -291,7 +290,7 @@ def set_percentage(value: int) -> None:
291290
app.invalidate()
292291

293292
def log_text(text: str) -> None:
294-
loop.call_soon_threadsafe(text_area.buffer.insert_text, text)
293+
app.loop.call_soon_threadsafe(text_area.buffer.insert_text, text)
295294
app.invalidate()
296295

297296
# Run the callback in the executor. When done, set a return value for the

0 commit comments

Comments
 (0)