aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/compiler.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-27 11:47:12 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-08-27 14:54:29 -0700
commit11fbaf29d8444ca35269a938e46327dfbe7820bd (patch)
tree135656b3fb49b4d185655f43fe1de62580788fee /mesonbuild/interpreter/compiler.py
parent3f5d80b8bbd40d166657c1c7f856fe7777623df1 (diff)
downloadmeson-11fbaf29d8444ca35269a938e46327dfbe7820bd.zip
meson-11fbaf29d8444ca35269a938e46327dfbe7820bd.tar.gz
meson-11fbaf29d8444ca35269a938e46327dfbe7820bd.tar.bz2
interpreter: fix cases of `KwargInfo(..., T, default=None)`
The correct way to mark these is `KwargInfo(..., (T, type(None)))`. There's also a few cases of `(T, None)` which is invalid, as `None` isn't a type
Diffstat (limited to 'mesonbuild/interpreter/compiler.py')
-rw-r--r--mesonbuild/interpreter/compiler.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/interpreter/compiler.py b/mesonbuild/interpreter/compiler.py
index 53c3ce0..54f4bee 100644
--- a/mesonbuild/interpreter/compiler.py
+++ b/mesonbuild/interpreter/compiler.py
@@ -17,7 +17,7 @@ from ..interpreterbase import (ObjectHolder, noPosargs, noKwargs,
InterpreterException)
from ..interpreterbase.decorators import ContainerTypeInfo, typed_kwargs, KwargInfo, typed_pos_args
from .interpreterobjects import (extract_required_kwarg, extract_search_dirs)
-from .type_checking import REQUIRED_KW, in_set_validator
+from .type_checking import REQUIRED_KW, in_set_validator, NoneType
if T.TYPE_CHECKING:
from ..interpreter import Interpreter
@@ -387,9 +387,9 @@ class CompilerHolder(ObjectHolder['Compiler']):
@typed_pos_args('compiler.compute_int', str)
@typed_kwargs(
'compiler.compute_int',
- KwargInfo('low', (int, None)),
- KwargInfo('high', (int, None)),
- KwargInfo('guess', (int, None)),
+ KwargInfo('low', (int, NoneType)),
+ KwargInfo('high', (int, NoneType)),
+ KwargInfo('guess', (int, NoneType)),
*_COMMON_KWS,
)
def compute_int_method(self, args: T.Tuple[str], kwargs: 'CompupteIntKW') -> int:
@@ -556,7 +556,7 @@ class CompilerHolder(ObjectHolder['Compiler']):
'compiler.find_library',
KwargInfo('required', (bool, coredata.UserFeatureOption), default=True),
KwargInfo('has_headers', ContainerTypeInfo(list, str), listify=True, default=[], since='0.50.0'),
- KwargInfo('static', (bool, None), since='0.51.0'),
+ KwargInfo('static', (bool, NoneType), since='0.51.0'),
KwargInfo('disabler', bool, default=False, since='0.49.0'),
KwargInfo('dirs', ContainerTypeInfo(list, str), listify=True, default=[]),
*[k.evolve(name=f'header_{k.name}') for k in _HEADER_KWS]