diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-11-23 15:30:23 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2010-12-08 22:24:12 -0700 |
commit | e48e9a2150ee76aaf151f6d5bc9e86e6ae4de514 (patch) | |
tree | 7a2370ee307c080160ab441df980bcf4ec5c2380 /lib/bb/taskdata.py | |
parent | 6b6ae76ba57ec5151529c647da3f9c66c382de82 (diff) | |
download | bitbake-e48e9a2150ee76aaf151f6d5bc9e86e6ae4de514.tar.gz |
taskdata: use 'any' in re_match_strings
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb/taskdata.py')
-rw-r--r-- | lib/bb/taskdata.py | 10 |
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: """ |