aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-03-08 14:49:23 +0200
committerGitHub <noreply@github.com>2020-03-08 14:49:23 +0200
commit44ff3e6c7de0db188284cc834b304e7b0e960d00 (patch)
treeda5c45cecc16083c5120a3977383b42bd9d4cbf2 /mesonbuild/mlog.py
parent91976a3489acbe53593e866fdb11951b515fda54 (diff)
parent06b1a317d26cbe2a1bd7a232dd9726590d0c0a48 (diff)
downloadmeson-44ff3e6c7de0db188284cc834b304e7b0e960d00.zip
meson-44ff3e6c7de0db188284cc834b304e7b0e960d00.tar.gz
meson-44ff3e6c7de0db188284cc834b304e7b0e960d00.tar.bz2
Merge pull request #6736 from dcbaker/mesonlib-type-annotations
Mesonlib type annotations
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