]> code.ossystems Code Review - openembedded-core.git/commitdiff
event: fix unicode handler registration
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 3 Jan 2011 19:57:23 +0000 (20:57 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 15:00:22 +0000 (15:00 +0000)
(Bitbake rev: 413af91e56a6d2368f6cbe22c0e2a337e1289e55)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/event.py

index 1d0fb7bfd188c00e4db8ec161114743f979207e1..3866e01f2b83f0a9574b959e7481dbb133fd0fb7 100644 (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