From 5323c39341acb461513e07a1e160cf4147b29d78 Mon Sep 17 00:00:00 2001 From: Abderrahim Kitouni Date: Mon, 10 Nov 2025 12:18:02 +0100 Subject: [PATCH] _yaml: fix confusing error message This moves the ruamel-yaml CParser import instantiation outside of try-catch. The catch reports 'Severely malformed YAML', which isn't the case if you you cant't import CParser --- src/buildstream/_yaml.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/buildstream/_yaml.pyx b/src/buildstream/_yaml.pyx index c962bb881..dc2bc95ce 100644 --- a/src/buildstream/_yaml.pyx +++ b/src/buildstream/_yaml.pyx @@ -293,10 +293,10 @@ cpdef MappingNode load(str filename, str shortname, bint copy_tree=False, object cpdef MappingNode load_data(str data, int file_index=node._SYNTHETIC_FILE_INDEX, str file_name=None, bint copy_tree=False): cdef Representer rep - try: - rep = Representer(file_index) - parser = yaml.CParser(data) + rep = Representer(file_index) + parser = yaml.CParser(data) + try: try: while parser.check_event(): rep.handle_event(parser.get_event())