Skip to content

Commit 8d64853

Browse files
committed
doc: fix regression that deleted all methods from the reference manual
Regressed in commit bfb1222. This needs to iterate over all methods, process them, and add them to a list. Instead, it deleted all methods, processed all remaining methods, and appended them to the in-use iterator. Use a second list, instead. Fixes mesonbuild#9922
1 parent 0185f2e commit 8d64853

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/refman/loaderyaml.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,12 @@ def as_methods(mlist: T.List[Function]) -> T.List[Method]:
274274
methods = raw.pop('methods', [])
275275
obj = Object(methods=[], obj_type=obj_type, **raw)
276276

277-
methods = []
277+
newmethods = []
278278
for x in methods:
279279
if not self.strict:
280280
x = {**self.template.s_function, **x}
281-
methods += [self._process_function_base(x, obj)]
282-
obj.methods = as_methods(methods)
281+
newmethods += [self._process_function_base(x, obj)]
282+
obj.methods = as_methods(newmethods)
283283
return obj
284284

285285
def _load_module(self, path: Path) -> T.List[Object]:

0 commit comments

Comments
 (0)