diff --git a/mkdocs/commands/babel.py b/mkdocs/commands/babel.py index 2ccadc28..9de5be8f 100644 --- a/mkdocs/commands/babel.py +++ b/mkdocs/commands/babel.py @@ -1,5 +1,6 @@ from __future__ import annotations +import sys from distutils.errors import DistutilsOptionError from os import path @@ -31,6 +32,12 @@ class compile_catalog(babel.compile_catalog, ThemeMixin): ("theme=", "t", "theme name to work on"), ] + def run(self): + # Possible bug in Babel - produces unused return value: + # https://github.com/python-babel/babel/blob/v2.10.3/babel/messages/frontend.py#L194 + if super().run(): + sys.exit(1) + def initialize_options(self): super().initialize_options() self.theme = None