commit: bf9cc359764dea70ce79c902026f3fe371494c6b Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sat Nov 22 18:16:48 2025 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Thu Nov 27 05:16:23 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=bf9cc359
streams.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/streams.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/portage/util/futures/_asyncio/streams.py b/lib/portage/util/futures/_asyncio/streams.py index 6b902975ce..cab6dc14ed 100644 --- a/lib/portage/util/futures/_asyncio/streams.py +++ b/lib/portage/util/futures/_asyncio/streams.py @@ -1,17 +1,9 @@ -# Copyright 2018-2021 Gentoo Authors +# Copyright 2018-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 import errno import os -import portage - -portage.proxy.lazyimport.lazyimport( - globals(), - "_emerge.PipeReader:PipeReader", - "portage.util.futures:asyncio", -) - def _reader(input_file, loop=None): """ @@ -25,6 +17,8 @@ def _reader(input_file, loop=None): @return: bytes @rtype: asyncio.Future (or compatible) """ + from portage.util.futures import asyncio + loop = asyncio._wrap_loop(loop) future = loop.create_future() _Reader(future, input_file, loop) @@ -33,6 +27,8 @@ def _reader(input_file, loop=None): class _Reader: def __init__(self, future, input_file, loop): + from _emerge.PipeReader import PipeReader + self._future = future self._pipe_reader = PipeReader( input_files={"input_file": input_file}, scheduler=loop @@ -71,6 +67,8 @@ async def _writer(output_file, content, loop=DeprecationWarning): @type content: bytes @param loop: deprecated """ + from portage.util.futures import asyncio + loop = asyncio.get_event_loop() fd = output_file.fileno() while content:
