From 548c9adad44ce88788356180fc2ec8e3665b3952 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 7 Nov 2022 15:00:12 -0500 Subject: Remove useless EmptyExternalProgram It is only used by Environment.get_exe_wrapper() and every callers were handling None already. Type annotation was wrong, it already could return None for the case an exe wrapper is needed but none is provided. --- mesonbuild/environment.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'mesonbuild/environment.py') diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index a9df75e..9691cf1 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -25,9 +25,7 @@ from .mesonlib import ( search_version, MesonBugException ) from . import mlog -from .programs import ( - ExternalProgram, EmptyExternalProgram -) +from .programs import ExternalProgram from .envconfig import ( BinaryTable, MachineInfo, Properties, known_cpu_families, CMakeVariables, @@ -852,7 +850,7 @@ class Environment: return value return not machine_info_can_run(self.machines[for_machine]) - def get_exe_wrapper(self) -> ExternalProgram: + def get_exe_wrapper(self) -> T.Optional[ExternalProgram]: if not self.need_exe_wrapper(): - return EmptyExternalProgram() + return None return self.exe_wrapper -- cgit v1.1