From 65029f4114b37423b673c292386a9c5be7896f64 Mon Sep 17 00:00:00 2001 From: Dima Krasner Date: Tue, 7 Feb 2017 09:41:57 +0200 Subject: [PATCH] Bug fix - KeyError on subproject without default options --- mesonbuild/interpreter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index cb5b6175d..8582740b2 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1576,9 +1576,10 @@ class Interpreter(InterpreterBase): @stringArgs def func_project(self, node, args, kwargs): - if self.environment.first_invocation and ('default_options' in kwargs or + default_options = kwargs.get('default_options', []) + if self.environment.first_invocation and (len(default_options) > 0 or len(self.default_project_options) > 0): - self.parse_default_options(kwargs['default_options']) + self.parse_default_options(default_options) if not self.is_subproject(): self.build.project_name = args[0] if os.path.exists(self.option_file):