event: fix unicode handler registration

(Bitbake rev: 413af91e56a6d2368f6cbe22c0e2a337e1289e55)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Bernhard Reutner-Fischer 2011-01-03 20:57:23 +01:00 committed by Richard Purdie
parent aae8532528
commit c0a11db877
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ def register(name, handler):
if handler is not None:
# handle string containing python code
if type(handler).__name__ == "str":
if isinstance(handler, basestring):
tmp = "def tmpHandler(e):\n%s" % handler
comp = bb.utils.better_compile(tmp, "tmpHandler(e)", "bb.event._registerCode")
_handlers[name] = comp