coredata: Malformed machine file is not a Meson bug

Fixes: #11899
This commit is contained in:
Xavier Claessens 2023-06-22 09:08:06 -04:00 committed by Xavier Claessens
parent ab17bd2393
commit c16dd8d711
1 changed files with 4 additions and 1 deletions

View File

@ -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'):