diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-03-02 11:11:10 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-03-05 09:31:29 -0800 |
commit | 1a82880730e2d9f58eaa67179aa40c6976835278 (patch) | |
tree | 67ba9416f558e4a76cd76f525ac166045fc5ac14 /mesonbuild/mlog.py | |
parent | a7407b8782ee81d605613a3fb485cdb165a865dc (diff) | |
download | meson-1a82880730e2d9f58eaa67179aa40c6976835278.zip meson-1a82880730e2d9f58eaa67179aa40c6976835278.tar.gz meson-1a82880730e2d9f58eaa67179aa40c6976835278.tar.bz2 |
mesonbuild/mesonlib: Add type annotations
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r-- | mesonbuild/mlog.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index ea75bd0..88a47e7 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -298,7 +298,7 @@ def exception(e: Exception, prefix: T.Optional[AnsiDecorator] = None) -> None: prefix = red('ERROR:') log() args = [] # type: T.List[T.Union[AnsiDecorator, str]] - if hasattr(e, 'file') and hasattr(e, 'lineno') and hasattr(e, 'colno'): + if getattr(e, 'file') is not None and getattr(e, 'lineno') is not None and getattr(e, 'colno') is not None: # Mypy doesn't follow hasattr, and it's pretty easy to visually inspect # that this is correct, so we'll just ignore it. path = get_relative_path(Path(e.file), Path(os.getcwd())) # type: ignore |