From c8bf252dbdb99f949ebf6f30ed9ac1b672d112b9 Mon Sep 17 00:00:00 2001 From: Christoph Auer Date: Mon, 25 Nov 2024 14:35:10 +0100 Subject: [PATCH] fix: Remove unnecessary case handling Signed-off-by: Christoph Auer --- docling/document_converter.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/docling/document_converter.py b/docling/document_converter.py index 9635078e..fae111be 100644 --- a/docling/document_converter.py +++ b/docling/document_converter.py @@ -200,13 +200,10 @@ class DocumentConverter: else: yield conv_res - if not had_result: - if raises_on_error: - raise RuntimeError( - f"Conversion failed because the provided file has no recognizable format or it wasn't in the list of allowed formats." - ) - else: - return None + if not had_result and raises_on_error: + raise RuntimeError( + f"Conversion failed because the provided file has no recognizable format or it wasn't in the list of allowed formats." + ) def _convert( self, conv_input: _DocumentConversionInput, raises_on_error: bool