From 4d5cd6e3c1c8d29717322513e32ddffb143f0efc Mon Sep 17 00:00:00 2001 From: yllar Date: Thu, 28 May 2026 20:58:55 +0300 Subject: [PATCH 1/3] Change event loop retrieval to new event loop --- songpal/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/songpal/main.py b/songpal/main.py index 5993216..ca5a558 100644 --- a/songpal/main.py +++ b/songpal/main.py @@ -45,7 +45,8 @@ def coro(f): """ def wrapper(*args, **kwargs): - loop = asyncio.get_event_loop() + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: return loop.run_until_complete(f(*args, **kwargs)) except KeyboardInterrupt: From a6b383afa6167ce4daf9e2c0fedd2ef2c3009bc1 Mon Sep 17 00:00:00 2001 From: yllar Date: Thu, 28 May 2026 21:01:29 +0300 Subject: [PATCH 2/3] Add Python versions 3.12, 3.13, and 3.14 to CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 033260d..def68b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: "actions/checkout@v3" From a35c5c562e0a2e51a8a11952592dcb3d8397819f Mon Sep 17 00:00:00 2001 From: yllar Date: Thu, 28 May 2026 21:15:49 +0300 Subject: [PATCH 3/3] Improve asyncio event loop management Refactor event loop handling to use get_running_loop --- songpal/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/songpal/main.py b/songpal/main.py index ca5a558..e9a1719 100644 --- a/songpal/main.py +++ b/songpal/main.py @@ -45,8 +45,11 @@ def coro(f): """ def wrapper(*args, **kwargs): - loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) + try: + loop = asyncio.get_running_loop() + except RuntimeError: + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) try: return loop.run_until_complete(f(*args, **kwargs)) except KeyboardInterrupt: