diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-13 19:05:29 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-28 11:54:03 +0000 |
commit | fa928e803bc41f1e49051bb0cb738acbd8c6f2ec (patch) | |
tree | 9cd7478c48e443578d02caa1e23ccee5aa05a920 /mesonbuild/mlog.py | |
parent | 63d67e20425b2da6668231fead3f86e16e163943 (diff) | |
download | meson-fa928e803bc41f1e49051bb0cb738acbd8c6f2ec.zip meson-fa928e803bc41f1e49051bb0cb738acbd8c6f2ec.tar.gz meson-fa928e803bc41f1e49051bb0cb738acbd8c6f2ec.tar.bz2 |
Remove unused MesonException.get_msg_with_context()
After that, the only remaining user of get_error_location_string() is mlog,
so move that there.
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r-- | mesonbuild/mlog.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index b28eca1..9387cb3 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -221,9 +221,18 @@ def log_once(*args: T.Union[str, AnsiDecorator], is_error: bool = False, _logged_once.add(t) log(*args, is_error=is_error, **kwargs) +# This isn't strictly correct. What we really want here is something like: +# class StringProtocol(typing_extensions.Protocol): +# +# def __str__(self) -> str: ... +# +# This would more accurately embody what this funcitonc an handle, but we +# don't have that yet, so instead we'll do some casting to work around it +def get_error_location_string(fname: str, lineno: str) -> str: + return '{}:{}:'.format(fname, lineno) + def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], once: bool = False, **kwargs: T.Any) -> None: - from .mesonlib import get_error_location_string from .environment import build_filename from .mesonlib import MesonException |