aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r--mesonbuild/mlog.py2
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