From f9bf2f231d750c9bb516de2f9c6a268990e1be7e Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Thu, 16 Oct 2025 19:29:37 +0300 Subject: [PATCH 1/3] Fix error on Python 3.14 --- async_tkinter_loop/async_tkinter_loop.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/async_tkinter_loop/async_tkinter_loop.py b/async_tkinter_loop/async_tkinter_loop.py index ac628e0..74f5551 100644 --- a/async_tkinter_loop/async_tkinter_loop.py +++ b/async_tkinter_loop/async_tkinter_loop.py @@ -110,6 +110,7 @@ async def some_async_function(): @wraps(async_function) def wrapper(*handler_args) -> None: - event_loop.create_task(async_function(*handler_args, *args, **kwargs)) + loop = event_loop or get_event_loop() + loop.create_task(async_function(*handler_args, *args, **kwargs)) return wrapper From d378cd275e2ac40fa0c6e481edfafb9eca16b4a2 Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Thu, 16 Oct 2025 19:29:52 +0300 Subject: [PATCH 2/3] Updat test --- tests/test_async_tk_loop.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_async_tk_loop.py b/tests/test_async_tk_loop.py index 437fbc2..9e059c4 100644 --- a/tests/test_async_tk_loop.py +++ b/tests/test_async_tk_loop.py @@ -32,10 +32,8 @@ async def on_click(_event): await asyncio.sleep(0.1) root.destroy() - event_loop = asyncio.new_event_loop() - async_handler(on_click, event_loop=event_loop)(Mock("Event")) - - async_mainloop(root, event_loop) + async_handler(on_click)(Mock("Event")) + async_mainloop(root) @pytest.mark.timeout(TIMEOUT) From c7a4e82f93ddb2c457a2d5efa6c34df798f84409 Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Thu, 16 Oct 2025 19:33:42 +0300 Subject: [PATCH 3/3] Revert "Updat test" This reverts commit d378cd275e2ac40fa0c6e481edfafb9eca16b4a2. --- tests/test_async_tk_loop.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_async_tk_loop.py b/tests/test_async_tk_loop.py index 9e059c4..437fbc2 100644 --- a/tests/test_async_tk_loop.py +++ b/tests/test_async_tk_loop.py @@ -32,8 +32,10 @@ async def on_click(_event): await asyncio.sleep(0.1) root.destroy() - async_handler(on_click)(Mock("Event")) - async_mainloop(root) + event_loop = asyncio.new_event_loop() + async_handler(on_click, event_loop=event_loop)(Mock("Event")) + + async_mainloop(root, event_loop) @pytest.mark.timeout(TIMEOUT)