summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Smyth <phillipsmyth@codethink.co.uk>2018-02-15 15:23:24 +0000
committerJürg Billeter <j@bitron.ch>2018-02-15 18:08:13 +0100
commitf275cf64913f1ebeb66f035e1a7a808c3240651b (patch)
tree2fc84ca17a9d077dba549ac2a53f04130acac1dc
parent57c8b8884828b900d64188a3032f5adb04d46372 (diff)
downloadbuildstream-f275cf64913f1ebeb66f035e1a7a808c3240651b.tar.gz
_yaml.py: Preserve quotes when run through yaml parsing
This preserves the quoting style for string values in round trips.
-rw-r--r--buildstream/_yaml.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py
index 0af53c5f7..c771e1b82 100644
--- a/buildstream/_yaml.py
+++ b/buildstream/_yaml.py
@@ -191,7 +191,7 @@ def load(filename, shortname=None, copy_tree=False):
def load_data(data, shortname=None, copy_tree=False):
try:
- contents = yaml.load(data, yaml.loader.RoundTripLoader)
+ contents = yaml.load(data, yaml.loader.RoundTripLoader, preserve_quotes=True)
except (yaml.scanner.ScannerError, yaml.composer.ComposerError, yaml.parser.ParserError) as e:
raise LoadError(LoadErrorReason.INVALID_YAML,
"Malformed YAML:\n\n{}\n\n{}\n".format(e.problem, e.problem_mark)) from e