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/codeparser.py | |
| 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/codeparser.py')
| -rw-r--r-- | bitbake/lib/bb/codeparser.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py index 70b0a8d136..b1d067a2f1 100644 --- a/bitbake/lib/bb/codeparser.py +++ b/bitbake/lib/bb/codeparser.py | |||
| @@ -1,22 +1,17 @@ | |||
| 1 | import ast | 1 | import ast |
| 2 | import sys | ||
| 2 | import codegen | 3 | import codegen |
| 3 | import logging | 4 | import logging |
| 5 | import pickle | ||
| 6 | import bb.pysh as pysh | ||
| 4 | import os.path | 7 | import os.path |
| 5 | import bb.utils, bb.data | 8 | import bb.utils, bb.data |
| 6 | from itertools import chain | 9 | from itertools import chain |
| 7 | from pysh import pyshyacc, pyshlex, sherrors | 10 | from bb.pysh import pyshyacc, pyshlex, sherrors |
| 8 | from bb.cache import MultiProcessCache | 11 | from bb.cache import MultiProcessCache |
| 9 | 12 | ||
| 10 | |||
| 11 | logger = logging.getLogger('BitBake.CodeParser') | 13 | logger = logging.getLogger('BitBake.CodeParser') |
| 12 | 14 | ||
| 13 | try: | ||
| 14 | import cPickle as pickle | ||
| 15 | except ImportError: | ||
| 16 | import pickle | ||
| 17 | logger.info('Importing cPickle failed. Falling back to a very slow implementation.') | ||
| 18 | |||
| 19 | |||
| 20 | def check_indent(codestr): | 15 | def check_indent(codestr): |
| 21 | """If the code is indented, add a top level piece of code to 'remove' the indentation""" | 16 | """If the code is indented, add a top level piece of code to 'remove' the indentation""" |
| 22 | 17 | ||
| @@ -68,7 +63,7 @@ class SetCache(object): | |||
| 68 | 63 | ||
| 69 | new = [] | 64 | new = [] |
| 70 | for i in items: | 65 | for i in items: |
| 71 | new.append(intern(i)) | 66 | new.append(sys.intern(i)) |
| 72 | s = frozenset(new) | 67 | s = frozenset(new) |
| 73 | if hash(s) in self.setcache: | 68 | if hash(s) in self.setcache: |
| 74 | return self.setcache[hash(s)] | 69 | return self.setcache[hash(s)] |
