aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-09-14 01:21:54 -0400
committerEli Schwartz <eschwartz@archlinux.org>2021-09-14 15:55:03 -0400
commit6cc1b8441c0cf7428e52bdf1cd541ea830a4eb83 (patch)
tree82c5b623d339d9acbf50929c2e61ac0e2b5c42fb /mesonbuild/mlog.py
parentcbfdfca089008eb5ca931121a692475044e64f95 (diff)
downloadmeson-6cc1b8441c0cf7428e52bdf1cd541ea830a4eb83.zip
meson-6cc1b8441c0cf7428e52bdf1cd541ea830a4eb83.tar.gz
meson-6cc1b8441c0cf7428e52bdf1cd541ea830a4eb83.tar.bz2
mark a couple of typing-only imports as noqa, to appease pyflakes
Since it cannot resolve `import typing as T` in order to figure out that T.* is doing annotation-worthy stuff. Since T.cast('Foo') is not actually using Foo except in an annotation context (due to being a string) it requires extra work to resolve, and the only thing that would currently work is actually using 'typing.cast'. However, we have decided to not use it except as T... Since this import is only imported during mypy it's not so bad to noqa it.
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r--mesonbuild/mlog.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py
index 06d8a0b..da9e2a5 100644
--- a/mesonbuild/mlog.py
+++ b/mesonbuild/mlog.py
@@ -22,7 +22,9 @@ from contextlib import contextmanager
from pathlib import Path
if T.TYPE_CHECKING:
- from ._typing import StringProtocol, SizedStringProtocol
+ # T.Union is not handled by flake8 to detect quoted annotation use (StringProtocol)
+ # see https://github.com/PyCQA/pyflakes/pull/632
+ from ._typing import StringProtocol, SizedStringProtocol # noqa: F401
"""This is (mostly) a standalone module used to write logging
information about Meson runs. Some output goes to screen,