Commit 4b400ca5 by Matt Martz

Only used stripped data for testing if the file is json, but used unstripped…

Only used stripped data for testing if the file is json, but used unstripped when actually parsing. Fixes #6348
parent 678fb4ff
......@@ -354,9 +354,9 @@ def smush_ds(data):
def parse_yaml(data, path_hint=None):
''' convert a yaml string to a data structure. Also supports JSON, ssssssh!!!'''
data = data.lstrip()
stripped_data = data.lstrip()
loaded = None
if data.startswith("{") or data.startswith("["):
if stripped_data.startswith("{") or stripped_data.startswith("["):
# since the line starts with { or [ we can infer this is a JSON document.
try:
loaded = json.loads(data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment