diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-11-09 18:52:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 18:52:23 +0200 |
commit | 4c1c605c577cd350d557445b62db94978f2833f1 (patch) | |
tree | ea760ce0d68d3a2e53f948805e08f4626138d1a3 /mesonbuild/mesonlib/universal.py | |
parent | 898bf6e518692fb9d895470438e04568cd670d58 (diff) | |
parent | 7a5eb6f9aaf70463978a749897ddf282832b38c1 (diff) | |
download | meson-4c1c605c577cd350d557445b62db94978f2833f1.zip meson-4c1c605c577cd350d557445b62db94978f2833f1.tar.gz meson-4c1c605c577cd350d557445b62db94978f2833f1.tar.bz2 |
Merge pull request #9396 from keszybz/drop-unused-and-unnecessary-printing-code
depfixer: drop unused and unnecessary printing code
Diffstat (limited to 'mesonbuild/mesonlib/universal.py')
-rw-r--r-- | mesonbuild/mesonlib/universal.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index a53892c..4655810 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -87,6 +87,7 @@ __all__ = [ 'exe_exists', 'expand_arguments', 'extract_as_list', + 'generate_list', 'get_compiler_for_source', 'get_filenames_templates_dict', 'get_library_dirs', @@ -1918,6 +1919,14 @@ def run_once(func: T.Callable[..., _T]) -> T.Callable[..., _T]: return wrapper +def generate_list(func: T.Callable[..., T.Generator[_T, None, None]]) -> T.Callable[..., T.List[_T]]: + @wraps(func) + def wrapper(*args: T.Any, **kwargs: T.Any) -> T.List[_T]: + return list(func(*args, **kwargs)) + + return wrapper + + class OptionOverrideProxy(collections.abc.MutableMapping): '''Mimic an option list but transparently override selected option |