python3Packages.pycyphal: fix doctests on python 3.14 (#518654)

This commit is contained in:
Yohann Boniface
2026-05-12 22:15:32 +00:00
committed by GitHub
2 changed files with 14 additions and 0 deletions
@@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
# build system
setuptools,
@@ -34,6 +35,9 @@ buildPythonPackage rec {
fetchSubmodules = true;
};
# Set an event loop in the doctest helper; policy.get_event_loop no longer auto-creates one on 3.14.
patches = lib.optional (pythonAtLeast "3.14") ./python-3.14-asyncio-loop.patch;
build-system = [ setuptools ];
pythonRelaxDeps = [ "numpy" ];
@@ -0,0 +1,10 @@
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -37,6 +37,7 @@
This function shall be invoked per test, because the test suite undoes its effect before starting the next test.
"""
_logger.info("asyncio_allow_event_loop_access_from_top_level()")
+ asyncio.set_event_loop(asyncio.new_event_loop())
def swap(mod: Any, name: str, new: Any) -> None:
restore = _PATCH_RESTORE_PREFIX + name