aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-06-22 09:08:06 -0400
committerXavier Claessens <xclaesse@gmail.com>2023-06-23 06:03:20 -0400
commitc16dd8d71197641ee4bbbebe8e10401201666cc8 (patch)
tree7e2e412e63029aa3f2eadd8a5113a453bce1d92d
parentab17bd2393b6973250a8e98f4fd06cde5045dca7 (diff)
downloadmeson-c16dd8d71197641ee4bbbebe8e10401201666cc8.zip
meson-c16dd8d71197641ee4bbbebe8e10401201666cc8.tar.gz
meson-c16dd8d71197641ee4bbbebe8e10401201666cc8.tar.bz2
coredata: Malformed machine file is not a Meson bug
Fixes: #11899
-rw-r--r--mesonbuild/coredata.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 0a09618..bdf3a5e 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -959,7 +959,10 @@ class MachineFileParser():
self.constants = {'True': True, 'False': False}
self.sections = {}
- self.parser.read(filenames)
+ try:
+ self.parser.read(filenames)
+ except configparser.Error as e:
+ raise EnvironmentException(f'Malformed cross or native file: {e}')
# Parse [constants] first so they can be used in other sections
if self.parser.has_section('constants'):