diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-11-07 15:00:12 -0500 |
|---|---|---|
| committer | Xavier Claessens <xavier.claessens@collabora.com> | 2022-12-07 11:58:36 -0500 |
| commit | 548c9adad44ce88788356180fc2ec8e3665b3952 (patch) | |
| tree | c1e227b54fdedbd861052e397ba797e878b8d556 /mesonbuild/environment.py | |
| parent | 302a29593a49c875adb5638375c1e5018efb7fb9 (diff) | |
| download | meson-548c9adad44ce88788356180fc2ec8e3665b3952.tar.gz | |
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.
Diffstat (limited to 'mesonbuild/environment.py')
| -rw-r--r-- | mesonbuild/environment.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index a9df75ee3..9691cf126 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 |
