summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-11-23 15:30:23 -0700
committerChris Larson <chris_larson@mentor.com>2010-12-08 22:24:12 -0700
commite48e9a2150ee76aaf151f6d5bc9e86e6ae4de514 (patch)
tree7a2370ee307c080160ab441df980bcf4ec5c2380 /lib
parent6b6ae76ba57ec5151529c647da3f9c66c382de82 (diff)
downloadbitbake-e48e9a2150ee76aaf151f6d5bc9e86e6ae4de514.tar.gz
taskdata: use 'any' in re_match_strings
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/taskdata.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/bb/taskdata.py b/lib/bb/taskdata.py
index fdd55ee83..d2a350578 100644
--- a/lib/bb/taskdata.py
+++ b/lib/bb/taskdata.py
@@ -24,6 +24,7 @@ Task data collection and handling
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import logging
+import re
import bb
logger = logging.getLogger("BitBake.TaskData")
@@ -33,13 +34,8 @@ def re_match_strings(target, strings):
Whether or not the string 'target' matches
any one string of the strings which can be regular expression string
"""
- import re
-
- for name in strings:
- if (name==target or
- re.search(name, target)!=None):
- return True
- return False
+ return any(name == target or re.search(name, target) != None
+ for name in strings)
class TaskData:
"""