From bc8971d122a02ed823acf0758da267dccc584f98 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 12 May 2016 08:30:35 +0100 Subject: bitbake: bitbake: Convert to python 3 megacommit This needs breaking up into smaller changes. (Bitbake rev: cf51f19aed208a75d38c14cd585d9b9f115e3ba3) Signed-off-by: Richard Purdie --- bitbake/lib/bb/codeparser.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'bitbake/lib/bb/codeparser.py') 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 @@ import ast +import sys import codegen import logging +import pickle +import bb.pysh as pysh import os.path import bb.utils, bb.data from itertools import chain -from pysh import pyshyacc, pyshlex, sherrors +from bb.pysh import pyshyacc, pyshlex, sherrors from bb.cache import MultiProcessCache - logger = logging.getLogger('BitBake.CodeParser') -try: - import cPickle as pickle -except ImportError: - import pickle - logger.info('Importing cPickle failed. Falling back to a very slow implementation.') - - def check_indent(codestr): """If the code is indented, add a top level piece of code to 'remove' the indentation""" @@ -68,7 +63,7 @@ class SetCache(object): new = [] for i in items: - new.append(intern(i)) + new.append(sys.intern(i)) s = frozenset(new) if hash(s) in self.setcache: return self.setcache[hash(s)] -- cgit v1.2.3-54-g00ecf