diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-04-03 09:11:07 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-04-03 14:48:29 -0700 |
commit | de48e887b8db039db6e921377b9c34fd6613ad7b (patch) | |
tree | 259e17f8e7b13d8a356a616e81a034f7717a7857 /mesonbuild/modules/python.py | |
parent | 82346a2bd241fcf34e66f34ac653b580e8f395ef (diff) | |
download | meson-de48e887b8db039db6e921377b9c34fd6613ad7b.zip meson-de48e887b8db039db6e921377b9c34fd6613ad7b.tar.gz meson-de48e887b8db039db6e921377b9c34fd6613ad7b.tar.bz2 |
modules/python: Do disabler check after validating inputs
This will help developers not introduce bugs (say putting 3 instead of
"python3"), and will be useful for the next patch.
Diffstat (limited to 'mesonbuild/modules/python.py')
-rw-r--r-- | mesonbuild/modules/python.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 693621b..027d0f7 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -498,9 +498,6 @@ class PythonModule(ExtensionModule): def find_installation(self, interpreter, state, args, kwargs): feature_check = FeatureNew('Passing "feature" option to find_installation', '0.48.0') disabled, required, feature = extract_required_kwarg(kwargs, state.subproject, feature_check) - if disabled: - mlog.log('find_installation skipped: feature', mlog.bold(feature), 'disabled') - return ExternalProgramHolder(NonExistingExternalProgram()) if len(args) > 1: raise InvalidArguments('find_installation takes zero or one positional argument.') @@ -511,6 +508,10 @@ class PythonModule(ExtensionModule): if not isinstance(name_or_path, str): raise InvalidArguments('find_installation argument must be a string.') + if disabled: + mlog.log('find_installation skipped: feature', mlog.bold(feature), 'disabled') + return ExternalProgramHolder(NonExistingExternalProgram()) + if not name_or_path: python = ExternalProgram('python3', mesonlib.python_command) else: |