diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-08-16 10:18:25 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-08-16 14:48:09 -0700 |
commit | f88a9cd6b374676e8f47da7137c8cd77c5bc2ccf (patch) | |
tree | 949a4d66e173e2e8d1251a62a833141b8711e3d9 /mesonbuild | |
parent | 8a7fdd91599823e2d7e693ce8525ed833c6a8126 (diff) | |
download | meson-f88a9cd6b374676e8f47da7137c8cd77c5bc2ccf.zip meson-f88a9cd6b374676e8f47da7137c8cd77c5bc2ccf.tar.gz meson-f88a9cd6b374676e8f47da7137c8cd77c5bc2ccf.tar.bz2 |
fs.read(): Catch FileNotFoundError
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/modules/fs.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py index 7d96995..53174d2 100644 --- a/mesonbuild/modules/fs.py +++ b/mesonbuild/modules/fs.py @@ -261,8 +261,10 @@ class FSModule(ExtensionModule): try: with open(path, encoding=encoding) as f: data = f.read() + except FileNotFoundError: + raise MesonException(f'File {args[0]} does not exist.') except UnicodeDecodeError: - raise MesonException(f'decoding failed for {path}') + raise MesonException(f'decoding failed for {args[0]}') # Reconfigure when this file changes as it can contain data used by any # part of the build configuration (e.g. `project(..., version: # fs.read_file('VERSION')` or `configure_file(...)` |