diff options
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 1e4e04b..07489a1 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -907,7 +907,12 @@ class CrossBuildInfo: def parse_datafile(self, filename): config = configparser.ConfigParser() - config.read(filename) + try: + f = open(filename, 'r') + config.read_file(f, filename) + f.close() + except FileNotFoundError: + raise EnvironmentException('File not found: %s.' % filename) # This is a bit hackish at the moment. for s in config.sections(): self.config[s] = {} |