diff --git a/src/calibre/ebooks/oeb/polish/check/main.py b/src/calibre/ebooks/oeb/polish/check/main.py index 256c57ac6e..ec4983374a 100644 --- a/src/calibre/ebooks/oeb/polish/check/main.py +++ b/src/calibre/ebooks/oeb/polish/check/main.py @@ -45,6 +45,9 @@ def run_checks(container): errors.extend(run_checkers(check_xml_parsing, html_items)) errors.extend(run_checkers(check_raster_images, raster_images)) + if errors: + return errors + # cssutils is not thread safe for name, mt, raw in stylesheets: if not raw: @@ -52,9 +55,6 @@ def run_checks(container): continue errors.extend(check_css_parsing(name, raw)) - if errors: - return errors - for name, mt, raw in html_items + xml_items: errors.extend(check_encoding_declarations(name, container))