From a366b6d876cefd4d77088731f94cdcdac4745043 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Tue, 20 Jan 2026 11:07:13 +0100 Subject: [PATCH 1/5] Asyncio Runner - new base class --- moler/asyncio_runner.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/moler/asyncio_runner.py b/moler/asyncio_runner.py index bfaf629bd..c7b6215bb 100644 --- a/moler/asyncio_runner.py +++ b/moler/asyncio_runner.py @@ -107,7 +107,19 @@ def stop(self): # class LoudEventLoopPolicy(asyncio.unix_events.DefaultEventLoopPolicy): -class LoudEventLoopPolicy(asyncio.DefaultEventLoopPolicy): +# DefaultEventLoopPolicy is deprecated in Python 3.14 and plant to remove in 3.16+ +# Use platform-specific event loop policy as base class +if sys.platform == 'win32': + _BaseEventLoopPolicy = asyncio.WindowsProactorEventLoopPolicy +else: + # On Linux and other Unix-like systems + try: + _BaseEventLoopPolicy = asyncio.unix_events._UnixDefaultEventLoopPolicy + except AttributeError: + # Fallback for older Python versions + _BaseEventLoopPolicy = asyncio.DefaultEventLoopPolicy +print(f"Using {_BaseEventLoopPolicy} as base for LoudEventLoopPolicy") +class LoudEventLoopPolicy(_BaseEventLoopPolicy): _loop_factory = LoudEventLoop From dc00991d6576529833bb3f3eabf8cb5f40faa706 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Tue, 20 Jan 2026 11:09:02 +0100 Subject: [PATCH 2/5] pep --- moler/asyncio_runner.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/moler/asyncio_runner.py b/moler/asyncio_runner.py index c7b6215bb..88a29ed8d 100644 --- a/moler/asyncio_runner.py +++ b/moler/asyncio_runner.py @@ -119,6 +119,8 @@ def stop(self): # Fallback for older Python versions _BaseEventLoopPolicy = asyncio.DefaultEventLoopPolicy print(f"Using {_BaseEventLoopPolicy} as base for LoudEventLoopPolicy") + + class LoudEventLoopPolicy(_BaseEventLoopPolicy): _loop_factory = LoudEventLoop From 3333b3c89563f20a38b0aaf46ff37d79d05c2028 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Tue, 20 Jan 2026 11:39:28 +0100 Subject: [PATCH 3/5] --print --- moler/asyncio_runner.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/moler/asyncio_runner.py b/moler/asyncio_runner.py index 88a29ed8d..86c813fc5 100644 --- a/moler/asyncio_runner.py +++ b/moler/asyncio_runner.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2018 Nokia +# Copyright (C) 2018-2026 Nokia """ Asyncio Runner """ -__author__ = 'Grzegorz Latuszek' -__copyright__ = 'Copyright (C) 2018, Nokia' -__email__ = 'grzegorz.latuszek@nokia.com' +__author__ = 'Grzegorz Latuszek, Marcin Usielski' +__copyright__ = 'Copyright (C) 2018-2026, Nokia' +__email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com' # pylint: skip-file @@ -118,7 +118,6 @@ def stop(self): except AttributeError: # Fallback for older Python versions _BaseEventLoopPolicy = asyncio.DefaultEventLoopPolicy -print(f"Using {_BaseEventLoopPolicy} as base for LoudEventLoopPolicy") class LoudEventLoopPolicy(_BaseEventLoopPolicy): From 668bd59a86d40cf6b25e76394c073ef0e5fae4b3 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Wed, 21 Jan 2026 10:18:20 +0100 Subject: [PATCH 4/5] Deleted unused code --- moler/asyncio_runner.py | 4 ++-- test/crt/test_unix.py | 1 + test/crt/test_unix_no_fork.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/moler/asyncio_runner.py b/moler/asyncio_runner.py index 86c813fc5..6cfcc695a 100644 --- a/moler/asyncio_runner.py +++ b/moler/asyncio_runner.py @@ -107,7 +107,7 @@ def stop(self): # class LoudEventLoopPolicy(asyncio.unix_events.DefaultEventLoopPolicy): -# DefaultEventLoopPolicy is deprecated in Python 3.14 and plant to remove in 3.16+ +# DefaultEventLoopPolicy is deprecated in Python 3.14 and planed to remove in 3.16 # Use platform-specific event loop policy as base class if sys.platform == 'win32': _BaseEventLoopPolicy = asyncio.WindowsProactorEventLoopPolicy @@ -121,7 +121,7 @@ def stop(self): class LoudEventLoopPolicy(_BaseEventLoopPolicy): - _loop_factory = LoudEventLoop + _loop_factory = LoudEventLoop def thread_secure_get_event_loop(logger_name="moler.runner.asyncio"): diff --git a/test/crt/test_unix.py b/test/crt/test_unix.py index db6f12255..219f425e2 100644 --- a/test/crt/test_unix.py +++ b/test/crt/test_unix.py @@ -89,6 +89,7 @@ def test_echo(unix_terminal): def test_dmesg(unix_terminal): unix = unix_terminal cmd_dmesg = unix.get_cmd(cmd_name="dmesg") + cmd_dmesg.add_failure_exception(r"Failed to connect to system scope bus via local transport") ret = cmd_dmesg() assert 'LINES' in ret diff --git a/test/crt/test_unix_no_fork.py b/test/crt/test_unix_no_fork.py index 070957faa..67e3e9128 100644 --- a/test/crt/test_unix_no_fork.py +++ b/test/crt/test_unix_no_fork.py @@ -89,6 +89,7 @@ def test_echo(unix_terminal): def test_dmesg(unix_terminal): unix = unix_terminal cmd_dmesg = unix.get_cmd(cmd_name="dmesg") + cmd_dmesg.add_failure_exception(r"Failed to connect to system scope bus via local transport") ret = cmd_dmesg() assert 'LINES' in ret From def2021ec2632afd76708fb20dbfbc4711cc20e5 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Wed, 21 Jan 2026 10:23:37 +0100 Subject: [PATCH 5/5] dev --- moler/asyncio_runner.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/moler/asyncio_runner.py b/moler/asyncio_runner.py index 6cfcc695a..8a3b8b968 100644 --- a/moler/asyncio_runner.py +++ b/moler/asyncio_runner.py @@ -106,24 +106,6 @@ def stop(self): super(LoudEventLoop, self).stop() -# class LoudEventLoopPolicy(asyncio.unix_events.DefaultEventLoopPolicy): -# DefaultEventLoopPolicy is deprecated in Python 3.14 and planed to remove in 3.16 -# Use platform-specific event loop policy as base class -if sys.platform == 'win32': - _BaseEventLoopPolicy = asyncio.WindowsProactorEventLoopPolicy -else: - # On Linux and other Unix-like systems - try: - _BaseEventLoopPolicy = asyncio.unix_events._UnixDefaultEventLoopPolicy - except AttributeError: - # Fallback for older Python versions - _BaseEventLoopPolicy = asyncio.DefaultEventLoopPolicy - - -class LoudEventLoopPolicy(_BaseEventLoopPolicy): - _loop_factory = LoudEventLoop - - def thread_secure_get_event_loop(logger_name="moler.runner.asyncio"): """ Need securing since asyncio.get_event_loop() when called from new thread