aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-02-13 16:35:31 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2017-02-20 23:32:03 +0530
commitaf1b898cc51d11074096cf34fb1410766def3edf (patch)
treeee6b16057533ac52402989177fe6f58e36ca5156
parenta6c71c62c826325a15c048f348863ac788750911 (diff)
downloadmeson-af1b898cc51d11074096cf34fb1410766def3edf.zip
meson-af1b898cc51d11074096cf34fb1410766def3edf.tar.gz
meson-af1b898cc51d11074096cf34fb1410766def3edf.tar.bz2
configure_file: Don't allow both command and configuration kwargs
-rw-r--r--mesonbuild/interpreter.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 224f98e..f232a93 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2214,9 +2214,13 @@ requirements use the version keyword argument instead.''')
raise InterpreterException("configure_file takes only keyword arguments.")
if 'output' not in kwargs:
raise InterpreterException('Required keyword argument "output" not defined.')
+ if 'configuration' in kwargs and 'command' in kwargs:
+ raise InterpreterException('Must not specify both "configuration" '
+ 'and "command" keyword arguments since '
+ 'they are mutually exclusive.')
inputfile = kwargs.get('input', None)
output = kwargs['output']
- if not isinstance(inputfile, (str, type(None))):
+ if inputfile is not None and not isinstance(inputfile, str):
raise InterpreterException('Input must be a string.')
if not isinstance(output, str):
raise InterpreterException('Output must be a string.')