summaryrefslogtreecommitdiffstats
path: root/lib/bb/parse/ast.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-06-20 12:08:07 -0700
committerChris Larson <chris_larson@mentor.com>2010-06-21 08:05:12 -0700
commit219be63895b20daa646066ae52872ce90a9da1e8 (patch)
treeedc4d84d6d995a899152e3058ceb589b01702d6c /lib/bb/parse/ast.py
parent40925230781ddd550bf21d90714c5349f9240a51 (diff)
downloadbitbake-219be63895b20daa646066ae52872ce90a9da1e8.tar.gz
Apply some 2to3 refactorings
Diffstat (limited to 'lib/bb/parse/ast.py')
-rw-r--r--lib/bb/parse/ast.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/bb/parse/ast.py b/lib/bb/parse/ast.py
index 4eabe5f2a..02d682d88 100644
--- a/lib/bb/parse/ast.py
+++ b/lib/bb/parse/ast.py
@@ -23,7 +23,7 @@
import bb, re, string
from bb import methodpool
-from itertools import chain
+import itertools
__word__ = re.compile(r"\S+")
__parsed_methods__ = bb.methodpool.get_parsed_dict()
@@ -31,7 +31,8 @@ _bbversions_re = re.compile(r"\[(?P<from>[0-9]+)-(?P<to>[0-9]+)\]")
class StatementGroup(list):
def eval(self, data):
- map(lambda x: x.eval(data), self)
+ for statement in self:
+ statement.eval(data)
class AstNode(object):
pass
@@ -341,7 +342,7 @@ def _expand_versions(versions):
versions = iter(versions)
while True:
try:
- version = versions.next()
+ version = next(versions)
except StopIteration:
break
@@ -351,7 +352,7 @@ def _expand_versions(versions):
else:
newversions = expand_one(version, int(range_ver.group("from")),
int(range_ver.group("to")))
- versions = chain(newversions, versions)
+ versions = itertools.chain(newversions, versions)
def multi_finalize(fn, d):
safe_d = d
@@ -417,7 +418,7 @@ def multi_finalize(fn, d):
safe_d.setVar("BBCLASSEXTEND", extended)
_create_variants(datastores, extended.split(), extendfunc)
- for variant, variant_d in datastores.items():
+ for variant, variant_d in datastores.iteritems():
if variant:
try:
finalize(fn, variant_d)
@@ -425,7 +426,7 @@ def multi_finalize(fn, d):
bb.data.setVar("__SKIPPED", True, variant_d)
if len(datastores) > 1:
- variants = filter(None, datastores.keys())
+ variants = filter(None, datastores.iterkeys())
safe_d.setVar("__VARIANTS", " ".join(variants))
datastores[""] = d