From 7a8b85c8004e36b4b2e7233534ae1b0dada47b69 Mon Sep 17 00:00:00 2001 From: Jonathan Slenders Date: Sat, 8 Nov 2025 21:00:03 +0000 Subject: [PATCH] Fix progress_dialog shortcut and examples/dialogs/progress_dialog.py --- src/prompt_toolkit/shortcuts/dialogs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/prompt_toolkit/shortcuts/dialogs.py b/src/prompt_toolkit/shortcuts/dialogs.py index d78e7dbdf..6d1f59cc6 100644 --- a/src/prompt_toolkit/shortcuts/dialogs.py +++ b/src/prompt_toolkit/shortcuts/dialogs.py @@ -264,7 +264,6 @@ def progress_dialog( :param run_callback: A function that receives as input a `set_percentage` function and it does the work. """ - loop = get_running_loop() progressbar = ProgressBar() text_area = TextArea( focusable=False, @@ -291,7 +290,7 @@ def set_percentage(value: int) -> None: app.invalidate() def log_text(text: str) -> None: - loop.call_soon_threadsafe(text_area.buffer.insert_text, text) + app.loop.call_soon_threadsafe(text_area.buffer.insert_text, text) app.invalidate() # Run the callback in the executor. When done, set a return value for the