diff options
Diffstat (limited to 'bitbake/lib/bb/event.py')
-rw-r--r-- | bitbake/lib/bb/event.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 29b14f6c32..6fb37128ea 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -24,10 +24,7 @@ BitBake build tools. | |||
24 | 24 | ||
25 | import os, sys | 25 | import os, sys |
26 | import warnings | 26 | import warnings |
27 | try: | 27 | import pickle |
28 | import cPickle as pickle | ||
29 | except ImportError: | ||
30 | import pickle | ||
31 | import logging | 28 | import logging |
32 | import atexit | 29 | import atexit |
33 | import traceback | 30 | import traceback |
@@ -107,7 +104,7 @@ def fire_class_handlers(event, d): | |||
107 | 104 | ||
108 | eid = str(event.__class__)[8:-2] | 105 | eid = str(event.__class__)[8:-2] |
109 | evt_hmap = _event_handler_map.get(eid, {}) | 106 | evt_hmap = _event_handler_map.get(eid, {}) |
110 | for name, handler in _handlers.iteritems(): | 107 | for name, handler in list(_handlers.items()): |
111 | if name in _catchall_handlers or name in evt_hmap: | 108 | if name in _catchall_handlers or name in evt_hmap: |
112 | if _eventfilter: | 109 | if _eventfilter: |
113 | if not _eventfilter(name, handler, event, d): | 110 | if not _eventfilter(name, handler, event, d): |
@@ -192,7 +189,7 @@ def register(name, handler, mask=None, filename=None, lineno=None): | |||
192 | 189 | ||
193 | if handler is not None: | 190 | if handler is not None: |
194 | # handle string containing python code | 191 | # handle string containing python code |
195 | if isinstance(handler, basestring): | 192 | if isinstance(handler, str): |
196 | tmp = "def %s(e):\n%s" % (name, handler) | 193 | tmp = "def %s(e):\n%s" % (name, handler) |
197 | try: | 194 | try: |
198 | code = bb.methodpool.compile_cache(tmp) | 195 | code = bb.methodpool.compile_cache(tmp) |