aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2023-12-11 01:12:22 -0500
committerEli Schwartz <eschwartz93@gmail.com>2024-02-12 18:52:43 -0500
commit6be1262cc9693d00b84f66d95691a29adff7b895 (patch)
tree79ba1a8e6b38d4afebe2ae2fc1a9d06623a2a2a4
parentdbfc9d0908626c42036f0a4a1e7d8c45eaedc7d2 (diff)
downloadmeson-6be1262cc9693d00b84f66d95691a29adff7b895.zip
meson-6be1262cc9693d00b84f66d95691a29adff7b895.tar.gz
meson-6be1262cc9693d00b84f66d95691a29adff7b895.tar.bz2
compilers: fix inconsistent None-breaking return value for compile()
Since commit abc7e6af01714206100a752898c325282436501f it is not possible for this set of methods to return None, which was an odd thing to return to begin with. Cease to annotate it as such.
-rw-r--r--mesonbuild/compilers/compilers.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index fbe30f6..74cb0bf 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -750,7 +750,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
def compile(self, code: 'mesonlib.FileOrString',
extra_args: T.Union[None, CompilerArgs, T.List[str]] = None,
*, mode: CompileCheckMode = CompileCheckMode.LINK, want_output: bool = False,
- temp_dir: T.Optional[str] = None) -> T.Iterator[T.Optional[CompileResult]]:
+ temp_dir: T.Optional[str] = None) -> T.Iterator[CompileResult]:
# TODO: there isn't really any reason for this to be a contextmanager
if mode == CompileCheckMode.PREPROCESS:
@@ -812,7 +812,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
def cached_compile(self, code: 'mesonlib.FileOrString', cdata: coredata.CoreData, *,
extra_args: T.Union[None, T.List[str], CompilerArgs] = None,
mode: CompileCheckMode = CompileCheckMode.LINK,
- temp_dir: T.Optional[str] = None) -> T.Iterator[T.Optional[CompileResult]]:
+ temp_dir: T.Optional[str] = None) -> T.Iterator[CompileResult]:
# TODO: There's isn't really any reason for this to be a context manager
# Calculate the key
@@ -1238,7 +1238,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
extra_args: T.Union[None, CompilerArgs, T.List[str], T.Callable[[CompileCheckMode], T.List[str]]] = None,
dependencies: T.Optional[T.List['Dependency']] = None,
mode: CompileCheckMode = CompileCheckMode.COMPILE, want_output: bool = False,
- disable_cache: bool = False) -> T.Iterator[T.Optional[CompileResult]]:
+ disable_cache: bool = False) -> T.Iterator[CompileResult]:
"""Helper for getting a cached value when possible.
This method isn't meant to be called externally, it's mean to be