diff options
author | James Hilliard <james.hilliard1@gmail.com> | 2019-10-24 20:20:53 +0200 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-11-07 17:32:05 +0530 |
commit | 45f0f3cdd0f83b9eb1678da446a0be0f1562f3a4 (patch) | |
tree | 49d0407c72d07b37d13e51706fd33c922faf817f | |
parent | 49317784be12db619668900303f266951ed6922e (diff) | |
download | meson-45f0f3cdd0f83b9eb1678da446a0be0f1562f3a4.zip meson-45f0f3cdd0f83b9eb1678da446a0be0f1562f3a4.tar.gz meson-45f0f3cdd0f83b9eb1678da446a0be0f1562f3a4.tar.bz2 |
Return a disabler when an unknown method is called on a disabler object
-rw-r--r-- | mesonbuild/interpreterbase.py | 7 | ||||
-rw-r--r-- | test cases/common/163 disabler/meson.build | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index 562ba27..a502692 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -803,8 +803,11 @@ The result of this is undefined and will become a hard error in a future Meson r (args, kwargs) = self.reduce_arguments(args) # Special case. This is the only thing you can do with a disabler # object. Every other use immediately returns the disabler object. - if isinstance(obj, Disabler) and method_name == 'found': - return False + if isinstance(obj, Disabler): + if method_name == 'found': + return False + else: + return Disabler() if is_disabled(args, kwargs): return Disabler() if method_name == 'extract_objects': diff --git a/test cases/common/163 disabler/meson.build b/test cases/common/163 disabler/meson.build index 1f0580c..5554f14 100644 --- a/test cases/common/163 disabler/meson.build +++ b/test cases/common/163 disabler/meson.build @@ -2,6 +2,9 @@ project('dolphin option', 'c') d = disabler() +full_path = d.full_path() +assert(is_disabler(full_path), 'Method call is not a disabler') + d2 = dependency(d) d3 = (d == d2) d4 = d + 0 |