Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Hiscocks <sdhiscocks@dstl.gov.uk>2021-09-20 14:16:14 +0300
committerSteven Hiscocks <sdhiscocks@dstl.gov.uk>2021-09-20 14:16:14 +0300
commite38456d4e14ffa28c7444198959410a84bfcd10f (patch)
tree8a3d07f7f17865cce4f4a99ba311d90e572a2829 /sphinx/util
parent274ee481acb3394b8cb62e06d7978e297dd657f1 (diff)
Fix issue with warnings without subtype being incorrectly suppressed
This fixes an issue with warnings that have been raised with no subtype being suppressed if a suppress warnings value with a subtype has been set. e.g. all `autodoc` warnings should not be suppressed if `autodoc.import_object` is only set to be suppressed.
Diffstat (limited to 'sphinx/util')
-rw-r--r--sphinx/util/logging.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/util/logging.py b/sphinx/util/logging.py
index e18d82469..8d1c94b44 100644
--- a/sphinx/util/logging.py
+++ b/sphinx/util/logging.py
@@ -364,7 +364,8 @@ def is_suppressed_warning(type: str, subtype: str, suppress_warnings: List[str])
target, subtarget = warning_type, None
if target == type:
- if (subtype is None or subtarget is None or
+ if (subtype is None and subtarget is None
+ or subtarget is None or
subtarget == subtype or subtarget == '*'):
return True