diff --git a/patacrep/build.py b/patacrep/build.py index f2c50036..12315447 100644 --- a/patacrep/build.py +++ b/patacrep/build.py @@ -131,10 +131,6 @@ class Songbook: yield from self._errors contentlist = self._config.get('content', content.ContentList()) yield from contentlist.iter_errors() - for item in contentlist: - if not hasattr(item, "iter_errors"): - continue - yield from item.iter_errors() def requires_lilypond(self): """Tell if lilypond is part of the bookoptions""" diff --git a/patacrep/content/__init__.py b/patacrep/content/__init__.py index 7cdc7061..85f6b7a4 100755 --- a/patacrep/content/__init__.py +++ b/patacrep/content/__init__.py @@ -185,6 +185,10 @@ class ContentList: def iter_errors(self): """Iterate over errors.""" yield from self._errors + for item in self: + if not hasattr(item, "iter_errors"): + continue + yield from item.iter_errors() class EmptyContentList(ContentList): """Empty content list: contain only errors."""