diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-01-02 19:45:19 -0500 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-01-02 19:45:19 -0500 |
commit | 57b0cf73291c4a44e846d45d833e57d7facc6a7d (patch) | |
tree | 805729e29857345bd5b85c1ccb54980808c18da3 /buildstream | |
parent | 7347c3379cac84bc9982abe82b1aa3c8b41d3391 (diff) | |
download | buildstream-57b0cf73291c4a44e846d45d833e57d7facc6a7d.tar.gz |
_yaml.py: Handle yaml.parser.ParserError in load()
And normalize to LoadError along with other ruamel.yaml errors.
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/_yaml.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py index 2ad45c78e..a8ba5368c 100644 --- a/buildstream/_yaml.py +++ b/buildstream/_yaml.py @@ -160,7 +160,7 @@ def load(filename, shortname=None): except FileNotFoundError as e: raise LoadError(LoadErrorReason.MISSING_FILE, "Could not find file at %s" % filename) from e - except (yaml.scanner.ScannerError, yaml.composer.ComposerError) as e: + except (yaml.scanner.ScannerError, yaml.composer.ComposerError, yaml.parser.ParserError) as e: raise LoadError(LoadErrorReason.INVALID_YAML, "Malformed YAML:\n\n%s\n\n%s\n" % (e.problem, e.problem_mark)) from e |