summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/interpreter/interpreter.py2
-rw-r--r--mesonbuild/utils/universal.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 6fa569555..66ea24cf3 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -3204,6 +3204,8 @@ class Interpreter(InterpreterBase, HoldableObject):
results: T.List['SourceOutputs'] = []
for s in sources:
if isinstance(s, str):
+ if s.endswith(' '):
+ raise MesonException(f'{s!r} ends with a space. This is probably an error.')
if not strict and s.startswith(self.environment.get_build_dir()):
results.append(s)
mlog.warning(f'Source item {s!r} cannot be converted to File object, because it is a generated file. '
diff --git a/mesonbuild/utils/universal.py b/mesonbuild/utils/universal.py
index 3ec23e105..edc7e3a24 100644
--- a/mesonbuild/utils/universal.py
+++ b/mesonbuild/utils/universal.py
@@ -398,7 +398,7 @@ class File(HoldableObject):
@staticmethod
@lru_cache(maxsize=None)
- def from_source_file(source_root: str, subdir: str, fname: str) -> 'File':
+ def from_source_file(source_root: str, subdir: str, fname: str) -> File:
if not os.path.isfile(os.path.join(source_root, subdir, fname)):
raise MesonException(f'File {fname} does not exist.')
return File(False, subdir, fname)