summaryrefslogtreecommitdiffstats
path: root/lib/bb/event.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-06-01 15:27:55 +0100
commitd0f904d407f57998419bd9c305ce53e5eaa36b24 (patch)
tree47488e99b76374cddf1566cb8af3f3c32bd13b76 /lib/bb/event.py
parentbf25f05ce4db11466e62f134f9a6916f886a93d9 (diff)
downloadbitbake-contrib-d0f904d407f57998419bd9c305ce53e5eaa36b24.tar.gz
bitbake: Convert to python 3
Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/event.py')
-rw-r--r--lib/bb/event.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/bb/event.py b/lib/bb/event.py
index 29b14f6c3..6fb37128e 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -24,10 +24,7 @@ BitBake build tools.
import os, sys
import warnings
-try:
- import cPickle as pickle
-except ImportError:
- import pickle
+import pickle
import logging
import atexit
import traceback
@@ -107,7 +104,7 @@ def fire_class_handlers(event, d):
eid = str(event.__class__)[8:-2]
evt_hmap = _event_handler_map.get(eid, {})
- for name, handler in _handlers.iteritems():
+ for name, handler in list(_handlers.items()):
if name in _catchall_handlers or name in evt_hmap:
if _eventfilter:
if not _eventfilter(name, handler, event, d):
@@ -192,7 +189,7 @@ def register(name, handler, mask=None, filename=None, lineno=None):
if handler is not None:
# handle string containing python code
- if isinstance(handler, basestring):
+ if isinstance(handler, str):
tmp = "def %s(e):\n%s" % (name, handler)
try:
code = bb.methodpool.compile_cache(tmp)