From ea2126790f57c8fbaef2c7307b0f9056484fc177 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 12 Sep 2024 15:27:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20early=20exit=20from=20`process?= =?UTF-8?q?=5Fwarnings`=20if=20no=20warnings=20(#1287)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sphinx_needs/warnings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sphinx_needs/warnings.py b/sphinx_needs/warnings.py index 2077a6032..ed0f71259 100644 --- a/sphinx_needs/warnings.py +++ b/sphinx_needs/warnings.py @@ -32,6 +32,10 @@ def process_warnings(app: Sphinx, exception: Exception | None) -> None: if exception: return + # If no warnings were defined, we do not need to do anything + if not NEEDS_CONFIG.warnings: + return + env = app.env needs = SphinxNeedsData(env).get_needs_view() # If no needs were defined, we do not need to do anything