From bced039f0876fe6853da2e2b451da2c05a836c17 Mon Sep 17 00:00:00 2001 From: PONS Date: Mon, 21 Sep 2026 10:33:08 +0200 Subject: [PATCH 1/3] Fix unawaited asynch call for python>3.13 (use of nest_asyncio2) --- pyaml_cs_oa/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyaml_cs_oa/__init__.py b/pyaml_cs_oa/__init__.py index e026c21..985c0a5 100644 --- a/pyaml_cs_oa/__init__.py +++ b/pyaml_cs_oa/__init__.py @@ -2,6 +2,7 @@ import asyncio import contextlib +import sys from typing import Any, Awaitable from ._version import __version__ @@ -27,9 +28,14 @@ def loop() -> asyncio.AbstractEventLoop: # We found a running loop (Jupyter case) if not _nest_asyncio_applied: try: - import nest_asyncio + if sys.version_info >= (3, 13): + import nest_asyncio2 + + nest_asyncio2.apply(running_loop) + else: + import nest_asyncio - nest_asyncio.apply(running_loop) + nest_asyncio.apply(running_loop) _nest_asyncio_applied = True except ImportError: pass From b6500cc7f7a3e82e0988b281a9984ec4c7f76f30 Mon Sep 17 00:00:00 2001 From: PONS Date: Mon, 21 Sep 2026 11:57:39 +0200 Subject: [PATCH 2/3] Fix incomplete patch --- pyaml_cs_oa/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyaml_cs_oa/__init__.py b/pyaml_cs_oa/__init__.py index 985c0a5..69602a7 100644 --- a/pyaml_cs_oa/__init__.py +++ b/pyaml_cs_oa/__init__.py @@ -51,9 +51,14 @@ def loop() -> asyncio.AbstractEventLoop: # Apply nest_asyncio to our new loop if not _nest_asyncio_applied: try: - import nest_asyncio + if sys.version_info >= (3, 13): + import nest_asyncio2 + + nest_asyncio2.apply(running_loop) + else: + import nest_asyncio - nest_asyncio.apply(_loop) + nest_asyncio.apply(_loop) _nest_asyncio_applied = True except ImportError: pass From aa416ee87b602c8e66b99c1291dd2ec2cb224ccf Mon Sep 17 00:00:00 2001 From: PONS Date: Mon, 21 Sep 2026 11:59:26 +0200 Subject: [PATCH 3/3] Fix incomplete patch --- pyaml_cs_oa/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaml_cs_oa/__init__.py b/pyaml_cs_oa/__init__.py index 69602a7..ec95685 100644 --- a/pyaml_cs_oa/__init__.py +++ b/pyaml_cs_oa/__init__.py @@ -54,7 +54,7 @@ def loop() -> asyncio.AbstractEventLoop: if sys.version_info >= (3, 13): import nest_asyncio2 - nest_asyncio2.apply(running_loop) + nest_asyncio2.apply(_loop) else: import nest_asyncio