summaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2023-07-12 17:47:12 -0500
committerTristan Partin <tristan@partin.io>2023-07-12 18:56:06 -0500
commitd4bcf05c39e650d9651b5f2c60e7c12d59367e9c (patch)
tree1d635627d62aba0d77142583c7d1479d5e7b4d31 /mesonbuild/environment.py
parent921c2370a722cbaa42bd256c699fae3185084939 (diff)
downloadmeson-d4bcf05c39e650d9651b5f2c60e7c12d59367e9c.tar.gz
Annotate naked fundamental Python types
Although mypy wasn't complaining, pyright was.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index c5cccf3f8..4e943ba4c 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -178,7 +178,7 @@ def get_llvm_tool_names(tool: str) -> T.List[str]:
'-15', # Debian development snapshot
'-devel', # FreeBSD development snapshot
]
- names = []
+ names: T.List[str] = []
for suffix in suffixes:
names.append(tool + suffix)
return names
@@ -197,15 +197,16 @@ def detect_scanbuild() -> T.List[str]:
Return: a single-element list of the found scan-build binary ready to be
passed to Popen()
"""
- exelist = []
+ exelist: T.List[str] = []
if 'SCANBUILD' in os.environ:
exelist = split_args(os.environ['SCANBUILD'])
else:
tools = get_llvm_tool_names('scan-build')
for tool in tools:
- if shutil.which(tool) is not None:
- exelist = [shutil.which(tool)]
+ which = shutil.which(tool)
+ if which is not None:
+ exelist = [which]
break
if exelist: