aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-06-14 15:36:17 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-06-22 09:13:41 -0700
commitd636b92c1adc1588ff11b6ee4972c4bdd686f433 (patch)
tree65511141ccd85f5c39a3e5b306a10086df595e2c /mesonbuild/interpreter/interpreter.py
parent7213b7d81fb2cc53d7fdca35409281045bae0fdc (diff)
downloadmeson-d636b92c1adc1588ff11b6ee4972c4bdd686f433.zip
meson-d636b92c1adc1588ff11b6ee4972c4bdd686f433.tar.gz
meson-d636b92c1adc1588ff11b6ee4972c4bdd686f433.tar.bz2
install_*: FileMode doesn't need to be None
There's no reason to allow None into the backend, it already has code to check that all of the values of the FileMode object are None, so let's use that, which is much simpler all the way down.
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r--mesonbuild/interpreter/interpreter.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index d522d25..8d1b693 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -128,7 +128,7 @@ def _install_mode_validator(mode: T.List[T.Union[str, bool, int]]) -> T.Optional
return None
-def _install_mode_convertor(mode: T.Optional[T.List[T.Union[str, bool, int]]]) -> T.Optional[FileMode]:
+def _install_mode_convertor(mode: T.Optional[T.List[T.Union[str, bool, int]]]) -> FileMode:
"""Convert the DSL form of the `install_mode` keyword arugment to `FileMode`
This is not required, and if not required returns None
@@ -136,8 +136,6 @@ def _install_mode_convertor(mode: T.Optional[T.List[T.Union[str, bool, int]]]) -
TODO: It's not clear to me why this needs to be None and not just return an
emtpy FileMode.
"""
- if mode is None:
- return None
# this has already been validated by the validator
return FileMode(*[m if isinstance(m, str) else None for m in mode])