diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-14 13:29:31 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-02-28 11:54:05 +0000 |
commit | c3163040aec7eb1486989369041b8a7d549cd9db (patch) | |
tree | 18ab5f4e6f6b3615c503d6acbce8de969dc8b557 | |
parent | 346b5c4be71bb1f502507d92ffdb1ded4c3bd85d (diff) | |
download | meson-c3163040aec7eb1486989369041b8a7d549cd9db.zip meson-c3163040aec7eb1486989369041b8a7d549cd9db.tar.gz meson-c3163040aec7eb1486989369041b8a7d549cd9db.tar.bz2 |
Display filename cwd relative in warning location
Format the filename relative to cwd in a warning location.
-rw-r--r-- | mesonbuild/mlog.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index b563e41..3f33240 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -234,7 +234,7 @@ def get_error_location_string(fname: str, lineno: str) -> str: def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], once: bool = False, **kwargs: T.Any) -> None: from .environment import build_filename - from .mesonlib import MesonException + from .mesonlib 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 @@ -251,7 +251,7 @@ def _log_error(severity: str, *rargs: T.Union[str, AnsiDecorator], location = kwargs.pop('location', None) if location is not None: - location_file = location.subdir + location_file = relpath(location.subdir, os.getcwd()) location_str = get_error_location_string(location_file, location.lineno) # Unions are frankly awful, and we have to T.cast here to get mypy # to understand that the list concatenation is safe |