aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/envconfig.py
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-02-25 02:45:20 -0500
committerDylan Baker <dylan@pnwbakers.com>2019-05-02 10:58:23 -0700
commit4c2617a9c6fd02e3f8831b7de8755380ac4bcb16 (patch)
tree0214fa8f65cd2b9ef66c88c588401907e868ed9f /mesonbuild/envconfig.py
parenta15a8b7e246be448e79ba20742e713e39807bd00 (diff)
downloadmeson-4c2617a9c6fd02e3f8831b7de8755380ac4bcb16.zip
meson-4c2617a9c6fd02e3f8831b7de8755380ac4bcb16.tar.gz
meson-4c2617a9c6fd02e3f8831b7de8755380ac4bcb16.tar.bz2
Add some type annotations and fix lints
Some things, like `method[...](...)` or `x: ... = ...` python 3.5 doesn't support, so I made a comment instead with the intention that it can someday be made into a real annotation.
Diffstat (limited to 'mesonbuild/envconfig.py')
-rw-r--r--mesonbuild/envconfig.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
index f4c371f..977d930 100644
--- a/mesonbuild/envconfig.py
+++ b/mesonbuild/envconfig.py
@@ -255,7 +255,7 @@ class MachineInfo:
def libdir_layout_is_win(self) -> bool:
return self.is_windows() or self.is_cygwin()
-class PerMachineDefaultable(PerMachine[_T]):
+class PerMachineDefaultable(PerMachine[typing.Optional[_T]]):
"""Extends `PerMachine` with the ability to default from `None`s.
"""
def __init__(self) -> None:
@@ -285,7 +285,7 @@ class PerMachineDefaultable(PerMachine[_T]):
if self.host == self.build:
self.host = None
-class MachineInfos(PerMachineDefaultable[typing.Optional[MachineInfo]]):
+class MachineInfos(PerMachineDefaultable[MachineInfo]):
def matches_build_machine(self, machine: MachineChoice) -> bool:
return self.build == self[machine]