commit: e02b51cb5fdcc8b6f69991260b35edc06cc7f282 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=e02b51cb
versions.py: Replace lazyimport with function local import Bug: https://bugs.gentoo.org/951146 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> lib/portage/versions.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/portage/versions.py b/lib/portage/versions.py index de8f801da9..cd91067ac5 100644 --- a/lib/portage/versions.py +++ b/lib/portage/versions.py @@ -1,5 +1,5 @@ # versions.py -- core Portage functionality -# Copyright 1998-2024 Gentoo Authors +# Copyright 1998-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 __all__ = [ @@ -22,14 +22,6 @@ from functools import lru_cache from typing import Any, Optional, Union from collections.abc import Sequence - -import portage - -portage.proxy.lazyimport.lazyimport( - globals(), - "portage.repository.config:_gen_valid_repo", - "portage.util:cmp_sort_key", -) from portage import _unicode_decode from portage.eapi import _eapi_attrs, _get_eapi_attrs from portage.exception import InvalidData @@ -405,6 +397,8 @@ class _pkg_str(str): db: Any = None, repoconfig: Any = None, ): + from portage.repository.config import _gen_valid_repo + if not isinstance(cpv, str): # Avoid TypeError from str.__init__ with PyPy. cpv = _unicode_decode(cpv) @@ -572,6 +566,7 @@ def cpv_sort_key(eapi: Any = None) -> Any: @return: object for use as the 'key' parameter in places like list.sort() or sorted() """ + from portage.util import cmp_sort_key split_cache = {}
