File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -272,11 +272,19 @@ def parse_sphinx_warnings(warning_text: str) -> List[DocBuildError]:
272272 continue
273273 warning_parts = sphinx_warning .split (":" , 2 )
274274 if len (warning_parts ) == 3 :
275- sphinx_build_errors .append (
276- DocBuildError (
277- file_path = warning_parts [0 ], line_no = int (warning_parts [1 ]), message = warning_parts [2 ]
275+ try :
276+ sphinx_build_errors .append (
277+ DocBuildError (
278+ file_path = warning_parts [0 ], line_no = int (warning_parts [1 ]), message = warning_parts [2 ]
279+ )
280+ )
281+ except Exception : # pylint: disable=broad-except
282+ # If an exception occurred while parsing the warning message, display the raw warning message.
283+ sphinx_build_errors .append (
284+ DocBuildError (
285+ file_path = None , line_no = None , message = sphinx_warning
286+ )
278287 )
279- )
280288 else :
281289 sphinx_build_errors .append (DocBuildError (file_path = None , line_no = None , message = sphinx_warning ))
282290 return sphinx_build_errors
You can’t perform that action at this time.
0 commit comments