From f80a0d6406ef403840c09e8cd0670dfd373babb8 Mon Sep 17 00:00:00 2001 From: Parsa Mahmoodi Date: Fri, 7 Nov 2025 23:00:22 +0400 Subject: [PATCH] fixed the runtime error also mentioned in issue #1740 --- examples/dialogs/progress_dialog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/dialogs/progress_dialog.py b/examples/dialogs/progress_dialog.py index 3d5227bc6..1c071d552 100755 --- a/examples/dialogs/progress_dialog.py +++ b/examples/dialogs/progress_dialog.py @@ -5,6 +5,7 @@ import os import time +import asyncio from prompt_toolkit.shortcuts import progress_dialog @@ -35,13 +36,13 @@ def worker(set_percentage, log_text): time.sleep(1) -def main(): - progress_dialog( +async def main(): + await progress_dialog( title="Progress dialog example", text="As an examples, we walk through the filesystem and print all directories", run_callback=worker, - ).run() + ).run_async() if __name__ == "__main__": - main() + asyncio.run(main())