Skip to content

Commit

Permalink
mlog: Avoid cyclic imports
Browse files Browse the repository at this point in the history
As utils/platform wants to use mlog, mlog should not sometimes attempt
to depend on mesonlib, as mesonlib will load platform
  • Loading branch information
sp1ritCS committed Nov 1, 2024
1 parent 1ff4a2f commit 1ddb69e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesonbuild/mlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def start_pager(self) -> None:
except Exception as e:
# Ignore errors, unless it is a user defined pager.
if 'PAGER' in os.environ:
from .mesonlib import MesonException
from .utils.core import MesonException
raise MesonException(f'Failed to start pager: {str(e)}')

def stop_pager(self) -> None:
Expand Down Expand Up @@ -271,7 +271,7 @@ def _log_error(self, severity: _Severity, *rargs: TV_Loggable,
nested: bool = True, sep: T.Optional[str] = None,
end: T.Optional[str] = None,
is_error: bool = True) -> None:
from .mesonlib import MesonException, relpath
from .utils.universal import MesonException, relpath

# The typing requirements here are non-obvious. Lists are invariant,
# therefore T.List[A] and T.List[T.Union[A, B]] are not able to be joined
Expand Down

0 comments on commit 1ddb69e

Please sign in to comment.