From 2cf7b802bf0a5f3c2716edb5da20cc54b8fe720b Mon Sep 17 00:00:00 2001 From: SergBobrovsky Date: Sun, 19 Dec 2021 19:05:22 +0300 Subject: Update Util.py all() and any() are `Built-in Functions`. https://docs.python.org/3/library/functions.html#built-in-funcs. --- SCons/Util.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/SCons/Util.py b/SCons/Util.py index cbd99b0..a665b81 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`.""" -- cgit v0.12