summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/codeparser.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-12 08:30:35 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-16 23:32:40 +0100
commitbc8971d122a02ed823acf0758da267dccc584f98 (patch)
treedd97329507feb611e64fad7f46d97d657f23eae4 /bitbake/lib/bb/codeparser.py
parente2f4d9f1ec694768b223decb59a9c768a2da962d (diff)
downloadpoky-bc8971d122a02ed823acf0758da267dccc584f98.tar.gz
bitbake: bitbake: Convert to python 3 megacommit This needs breaking up into smaller changes.
(Bitbake rev: cf51f19aed208a75d38c14cd585d9b9f115e3ba3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/codeparser.py')
-rw-r--r--bitbake/lib/bb/codeparser.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/bitbake/lib/bb/codeparser.py b/bitbake/lib/bb/codeparser.py
index 3ee4d5622b..bbdddecac4 100644
--- a/bitbake/lib/bb/codeparser.py
+++ b/bitbake/lib/bb/codeparser.py
@@ -1,22 +1,17 @@
1import ast 1import ast
2import sys
2import codegen 3import codegen
3import logging 4import logging
5import pickle
6import bb.pysh as pysh
4import os.path 7import os.path
5import bb.utils, bb.data 8import bb.utils, bb.data
6from itertools import chain 9from itertools import chain
7from pysh import pyshyacc, pyshlex, sherrors 10from bb.pysh import pyshyacc, pyshlex, sherrors
8from bb.cache import MultiProcessCache 11from bb.cache import MultiProcessCache
9 12
10
11logger = logging.getLogger('BitBake.CodeParser') 13logger = logging.getLogger('BitBake.CodeParser')
12 14
13try:
14 import cPickle as pickle
15except ImportError:
16 import pickle
17 logger.info('Importing cPickle failed. Falling back to a very slow implementation.')
18
19
20def check_indent(codestr): 15def 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)]