diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-12 08:30:35 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-02 08:24:02 +0100 |
commit | 0f2c59367a649de5f57acdccfb4f1fdba9cde730 (patch) | |
tree | 7a3558a3e08e690fbb0b5bdc4044316f9ab4bbcb /bitbake/lib/bb/parse | |
parent | ef1df516512587ad415f76a9626620992d660e45 (diff) | |
download | poky-0f2c59367a649de5f57acdccfb4f1fdba9cde730.tar.gz |
bitbake: bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant
separation into separate commits.
(Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse')
-rw-r--r-- | bitbake/lib/bb/parse/ast.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py index bc3a2f8826..548929f63d 100644 --- a/bitbake/lib/bb/parse/ast.py +++ b/bitbake/lib/bb/parse/ast.py | |||
@@ -138,7 +138,7 @@ class DataNode(AstNode): | |||
138 | data.setVar(key, val, parsing=True, **loginfo) | 138 | data.setVar(key, val, parsing=True, **loginfo) |
139 | 139 | ||
140 | class MethodNode(AstNode): | 140 | class MethodNode(AstNode): |
141 | tr_tbl = string.maketrans('/.+-@%&', '_______') | 141 | tr_tbl = str.maketrans('/.+-@%&', '_______') |
142 | 142 | ||
143 | def __init__(self, filename, lineno, func_name, body, python, fakeroot): | 143 | def __init__(self, filename, lineno, func_name, body, python, fakeroot): |
144 | AstNode.__init__(self, filename, lineno) | 144 | AstNode.__init__(self, filename, lineno) |
@@ -340,17 +340,17 @@ def _create_variants(datastores, names, function, onlyfinalise): | |||
340 | function(arg or name, new_d) | 340 | function(arg or name, new_d) |
341 | datastores[name] = new_d | 341 | datastores[name] = new_d |
342 | 342 | ||
343 | for variant, variant_d in datastores.items(): | 343 | for variant in list(datastores.keys()): |
344 | for name in names: | 344 | for name in names: |
345 | if not variant: | 345 | if not variant: |
346 | # Based on main recipe | 346 | # Based on main recipe |
347 | create_variant(name, variant_d) | 347 | create_variant(name, datastores[""]) |
348 | else: | 348 | else: |
349 | create_variant("%s-%s" % (variant, name), variant_d, name) | 349 | create_variant("%s-%s" % (variant, name), datastores[variant], name) |
350 | 350 | ||
351 | def _expand_versions(versions): | 351 | def _expand_versions(versions): |
352 | def expand_one(version, start, end): | 352 | def expand_one(version, start, end): |
353 | for i in xrange(start, end + 1): | 353 | for i in range(start, end + 1): |
354 | ver = _bbversions_re.sub(str(i), version, 1) | 354 | ver = _bbversions_re.sub(str(i), version, 1) |
355 | yield ver | 355 | yield ver |
356 | 356 | ||
@@ -459,16 +459,16 @@ def multi_finalize(fn, d): | |||
459 | safe_d.setVar("BBCLASSEXTEND", extended) | 459 | safe_d.setVar("BBCLASSEXTEND", extended) |
460 | _create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise) | 460 | _create_variants(datastores, extendedmap.keys(), extendfunc, onlyfinalise) |
461 | 461 | ||
462 | for variant, variant_d in datastores.iteritems(): | 462 | for variant in datastores.keys(): |
463 | if variant: | 463 | if variant: |
464 | try: | 464 | try: |
465 | if not onlyfinalise or variant in onlyfinalise: | 465 | if not onlyfinalise or variant in onlyfinalise: |
466 | finalize(fn, variant_d, variant) | 466 | finalize(fn, datastores[variant], variant) |
467 | except bb.parse.SkipRecipe as e: | 467 | except bb.parse.SkipRecipe as e: |
468 | variant_d.setVar("__SKIPPED", e.args[0]) | 468 | datastores[variant].setVar("__SKIPPED", e.args[0]) |
469 | 469 | ||
470 | if len(datastores) > 1: | 470 | if len(datastores) > 1: |
471 | variants = filter(None, datastores.iterkeys()) | 471 | variants = filter(None, datastores.keys()) |
472 | safe_d.setVar("__VARIANTS", " ".join(variants)) | 472 | safe_d.setVar("__VARIANTS", " ".join(variants)) |
473 | 473 | ||
474 | datastores[""] = d | 474 | datastores[""] = d |