aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/disabler.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/interpreterbase/disabler.py')
-rw-r--r--mesonbuild/interpreterbase/disabler.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/mesonbuild/interpreterbase/disabler.py b/mesonbuild/interpreterbase/disabler.py
index 81f5264..63b914e 100644
--- a/mesonbuild/interpreterbase/disabler.py
+++ b/mesonbuild/interpreterbase/disabler.py
@@ -12,16 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from .baseobjects import MesonInterpreterObject
+from .baseobjects import MesonInterpreterObject, TYPE_var, TYPE_kwargs
import typing as T
class Disabler(MesonInterpreterObject):
- def __init__(self) -> None:
- super().__init__()
- self.methods.update({'found': self.found_method})
-
- def found_method(self, args: T.Sequence[T.Any], kwargs: T.Dict[str, T.Any]) -> bool:
- return False
+ def method_call(self, method_name: str, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> TYPE_var:
+ if method_name == 'found':
+ return False
+ return Disabler()
def _is_arg_disabled(arg: T.Any) -> bool:
if isinstance(arg, Disabler):