From 036caec67833646edac113a25e2310830cee96bb Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 11 Dec 2024 12:45:56 -0800 Subject: [PATCH] dependencies/mpi: Correctly handle a language of None --- mesonbuild/dependencies/mpi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/dependencies/mpi.py b/mesonbuild/dependencies/mpi.py index 2d9e992f6f5a..a259972b0586 100644 --- a/mesonbuild/dependencies/mpi.py +++ b/mesonbuild/dependencies/mpi.py @@ -27,7 +27,9 @@ def mpi_factory(env: 'Environment', for_machine: 'MachineChoice', kwargs: T.Dict[str, T.Any], methods: T.List[DependencyMethods]) -> T.List['DependencyGenerator']: - language = kwargs.get('language', 'c') + language = kwargs.get('language') + if language is None: + language = 'c' if language not in {'c', 'cpp', 'fortran'}: # OpenMPI doesn't work without any other languages return []