summaryrefslogtreecommitdiff
path: root/sphinx/ext/coverage.py
diff options
context:
space:
mode:
authordanieleades <33452915+danieleades@users.noreply.github.com>2023-01-02 04:52:46 +0000
committerGitHub <noreply@github.com>2023-01-02 04:52:46 +0000
commit2759c2c76b5cd09e9dfffbd88ea1b200dcd8d6ae (patch)
treea1ffe3ce69c2fbf2dd457906622fb6ca6cc08501 /sphinx/ext/coverage.py
parentda6a20d50b725f6c33f0f940e2a59c9a4e7edc15 (diff)
downloadsphinx-git-2759c2c76b5cd09e9dfffbd88ea1b200dcd8d6ae.tar.gz
Use ``any`` to find elements in iterable (#11053)
Diffstat (limited to 'sphinx/ext/coverage.py')
-rw-r--r--sphinx/ext/coverage.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/ext/coverage.py b/sphinx/ext/coverage.py
index 362a644f5..6c70d4112 100644
--- a/sphinx/ext/coverage.py
+++ b/sphinx/ext/coverage.py
@@ -130,10 +130,10 @@ class CoverageBuilder(Builder):
op.write('\n')
def ignore_pyobj(self, full_name: str) -> bool:
- for exp in self.py_ignorexps:
- if exp.search(full_name):
- return True
- return False
+ return any(
+ exp.search(full_name)
+ for exp in self.py_ignorexps
+ )
def build_py_coverage(self) -> None:
objects = self.env.domaindata['py']['objects']