commit: 49822d396075b041885ce3bd49648eb1f47abf70 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sat Nov 22 20:03:54 2025 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Thu Nov 27 05:16:24 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=49822d39
_asyncio/__init__.py: Replace lazyimport with function local import Bug: https://bugs.gentoo.org/951146 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/portage/util/futures/_asyncio/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/portage/util/futures/_asyncio/__init__.py b/lib/portage/util/futures/_asyncio/__init__.py index 9f248bf90e..940dc7c31a 100644 --- a/lib/portage/util/futures/_asyncio/__init__.py +++ b/lib/portage/util/futures/_asyncio/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2018-2024 Gentoo Authors +# Copyright 2018-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 __all__ = ( @@ -49,11 +49,7 @@ import threading from typing import Optional import portage - -portage.proxy.lazyimport.lazyimport( - globals(), - "portage.util.futures.unix_events:_PortageEventLoopPolicy", -) +from portage.process import atexit_register from portage.util._eventloop.asyncio_event_loop import ( AsyncioEventLoop as _AsyncioEventLoop, ) @@ -70,6 +66,8 @@ def get_event_loop_policy(): @rtype: asyncio.AbstractEventLoopPolicy (or compatible) @return: the current event loop policy """ + from portage.util.futures.unix_events import _PortageEventLoopPolicy + global _lock, _policy with _lock: if _policy is None: @@ -85,6 +83,8 @@ def set_event_loop_policy(policy): @type policy: asyncio.AbstractEventLoopPolicy or None @param policy: new event loop policy """ + from portage.util.futures.unix_events import _PortageEventLoopPolicy + global _lock, _policy with _lock: _policy = policy or _PortageEventLoopPolicy() @@ -433,4 +433,4 @@ def _thread_weakrefs_atexit(): _thread_weakrefs = types.SimpleNamespace( lock=threading.Lock(), loops=None, mainloop=None, pid=None ) -portage.process.atexit_register(_thread_weakrefs_atexit) +atexit_register(_thread_weakrefs_atexit)
