summaryrefslogtreecommitdiffstats
path: root/SCons/Util.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2021-12-19 22:52:27 (GMT)
committerGitHub <noreply@github.com>2021-12-19 22:52:27 (GMT)
commit2c6e50bf0ffa0c272d650a2f0ad76867d82d54e4 (patch)
treef6bbc00b04177db6a303f2345ec5df29193475ed /SCons/Util.py
parentdbca6ec6eb8f331505787326ffd60a4ade5e8ba7 (diff)
parent2cf7b802bf0a5f3c2716edb5da20cc54b8fe720b (diff)
downloadSCons-2c6e50bf0ffa0c272d650a2f0ad76867d82d54e4.zip
SCons-2c6e50bf0ffa0c272d650a2f0ad76867d82d54e4.tar.gz
SCons-2c6e50bf0ffa0c272d650a2f0ad76867d82d54e4.tar.bz2
Merge pull request #4076 from SergBobrovsky/patch-3
Update Util.py
Diffstat (limited to 'SCons/Util.py')
-rw-r--r--SCons/Util.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/SCons/Util.py b/SCons/Util.py
index d486867..6a0f8ac 100644
--- a/SCons/Util.py
+++ b/SCons/Util.py
@@ -70,17 +70,11 @@ else:
# (Yeah, yeah, YAGNI...)
def containsAny(s, pat) -> bool:
"""Check whether string `s` contains ANY of the items in `pat`."""
- for c in pat:
- if c in s:
- return True
- return False
+ return any(c in s for c in pat)
def containsAll(s, pat) -> bool:
"""Check whether string `s` contains ALL of the items in `pat`."""
- for c in pat:
- if c not in s:
- return False
- return True
+ return all(c in s for c in pat)
def containsOnly(s, pat) -> bool:
"""Check whether string `s` contains ONLY items in `pat`."""